Use Tomcat to get HTML

  • Follow


Hi Everybody,

Does anyone know of a post that discusses a way to use Tomcat to
generate HTML from a JSP file?

I have a need to generate HTML and provide it as a text file locally
(i.e. create a local application that will create a file that contains
the appropriate HTML).  I would like to write the HTML as a JSP so I
can leverage all of the benefits that go along with writing JSP
instead having to generate the HTML inline in Java source code.

Is there a better way to do this?

When I search on something like jsp to html or render jsp as html the
hits I get refer to ways of doing this as one normally would (i.e.
running Tomcat as a server and making requests through a browser).

Thanks,
John
0
Reply grasp06110 (25) 12/9/2009 4:12:20 AM

grasp06110 wrote:

> I would like to write the HTML as a JSP so I
> can leverage all of the benefits that go along with writing JSP
> instead having to generate the HTML inline in Java source code.


This part makes no sense to me.  JSP *do* generate HTML.  I think 
perhaps that's all they do.  How are you having a hard time?

Here is a JSP.  How does this not generate HTML?

<html>
   <body>
     <h1>The Message</h1>
     Your message is:
     <% out.println( "Hello World!" ); %>
   </body>
</html>


0
Reply markspace 12/9/2009 6:09:36 AM


On Dec 8, 11:12=A0pm, grasp06110 <grasp06...@yahoo.com> wrote:
> Hi Everybody,
>
> Does anyone know of a post that discusses a way to use Tomcat to
> generate HTML from a JSP file?
>
> I have a need to generate HTML and provide it as a text file locally
> (i.e. create a local application that will create a file that contains
> the appropriate HTML). =A0I would like to write the HTML as a JSP so I
> can leverage all of the benefits that go along with writing JSP
> instead having to generate the HTML inline in Java source code.
>
> Is there a better way to do this?
>
> When I search on something like jsp to html or render jsp as html the
> hits I get refer to ways of doing this as one normally would (i.e.
> running Tomcat as a server and making requests through a browser).
>
> Thanks,
> John

If you use Eclipse IDE to develop JSP software, Eclipse application
will generate a template for you, then you can modify from there.
0
Reply moongeegee 12/11/2009 6:54:07 PM

On Tue, 8 Dec 2009 20:12:20 -0800 (PST), grasp06110
<grasp06110@yahoo.com> wrote, quoted or indirectly quoted someone who
said :

>
>Does anyone know of a post that discusses a way to use Tomcat to
>generate HTML from a JSP file?
>
>I have a need to generate HTML and provide it as a text file locally
>(i.e. create a local application that will create a file that contains
>the appropriate HTML).  I would like to write the HTML as a JSP so I
>can leverage all of the benefits that go along with writing JSP
>instead having to generate the HTML inline in Java source code.
>
>Is there a better way to do this?
>
>When I search on something like jsp to html or render jsp as html the
>hits I get refer to ways of doing this as one normally would (i.e.
>running

One way to do it would be to use a utility like download that
simulates a browser.  You give it an local URL on the command line and
the name of a file where to store the result. Or you could use the
methods of the FileTransfer class wrapped in a loop to generate HTML
for your entire website.  See
http://mindprod.com/products1.html#FILETRANSFER

You also could probably write a servlet that fakes transactions coming
it and routes them.

-- 
Roedy Green Canadian Mind Products
http://mindprod.com
The future has already happened, it just isn�t evenly distributed. 
~ William Gibson (born: 1948-03-17 age: 61)
0
Reply Roedy 12/12/2009 6:11:24 AM

grasp06110 wrote:
> Hi Everybody,
> 
> Does anyone know of a post that discusses a way to use Tomcat to
> generate HTML from a JSP file?
> 
> I have a need to generate HTML and provide it as a text file locally
> (i.e. create a local application that will create a file that contains
> the appropriate HTML).  I would like to write the HTML as a JSP so I
> can leverage all of the benefits that go along with writing JSP
> instead having to generate the HTML inline in Java source code.
> 
> Is there a better way to do this?
> 
> When I search on something like jsp to html or render jsp as html the
> hits I get refer to ways of doing this as one normally would (i.e.
> running Tomcat as a server and making requests through a browser).
> 
> Thanks,
> John

John, one possible way is to deploy the application on Tomcat, write a 
simple program to visit those JSP pages, and save the resulting HTML 
pages you get automatically.

Tony
0
Reply Tony 12/13/2009 4:46:59 PM

4 Replies
155 Views

(page loaded in 0.162 seconds)

Similiar Articles:













7/15/2012 6:30:56 AM


Reply: