You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jacob Wilson <st...@yahoo.com> on 2004/01/23 20:30:41 UTC

JSP to static html...

Hi All...
 
I have a specific requirement in my project... I want to convert the JSP pages to static html pages and save them in a local directory... How do I achieve this functionality??? Any suggestions appreciated.
 
Thanks much.
 
-Jacob


---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!

RE: JSP to static html...

Posted by Wiebe de Jong <wi...@shaw.ca>.
David,

I have had this situation come up before and it is quite valid.

I once wrote a catalog web app for a client with only a couple of templates
but hundreds of items in the database. They wanted a static cdrom version of
the catalog for customers so I used a tool (can't remember the name now but
it started with an 'x') to spider through the site, make an html copy of all
the pages, and fix the links appropriately.

The only tools I can think of now are: 
Zylox: http://www.zylox.com/tasks/dynamic2static.shtm 
Teleport Pro: http://www.tenmax.com/teleport/pro/home.htm 

Wiebe

-----Original Message-----
From: David Erickson [mailto:derickson@cmcflex.com] 
Sent: Friday, January 23, 2004 2:14 PM
To: Struts Users Mailing List
Subject: Re: JSP to static html...

I don't know the layouts of your jsps or what you are doing in them.. but
JSP's are inherently non-static because they use runtime expressions to
generate the html, and that can change on a per request basis.  If you are
using strictly html and no RT expressions or tags or anything I don't see
why you couldnt just rename the extension from jsp to html and save it
wherever you want.
-David

----- Original Message ----- 
From: "Jacob Wilson" <st...@yahoo.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Friday, January 23, 2004 12:30 PM
Subject: JSP to static html...


> Hi All...
>
> I have a specific requirement in my project... I want to convert the JSP
pages to static html pages and save them in a local directory... How do I
achieve this functionality??? Any suggestions appreciated.
>
> Thanks much.
>
> -Jacob
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free web site building tool. Try it!


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: JSP to static html...

Posted by Jacob Wilson <st...@yahoo.com>.
Actually, this is therequirement... One jsp page(contains scriptlets, dynamic values. etal) in the current application generates a report. Now, I need to present with a button at the end of the page.
 
When I click on that button, this page should be converted into a static html and then 
ftp this html page to one of the servers...
 
I know uploading could be done without probs... But, the only question I have is how do I convert that page into an html???

David Erickson <de...@cmcflex.com> wrote:
I don't know the layouts of your jsps or what you are doing in them.. but
JSP's are inherently non-static because they use runtime expressions to
generate the html, and that can change on a per request basis. If you are
using strictly html and no RT expressions or tags or anything I don't see
why you couldnt just rename the extension from jsp to html and save it
wherever you want.
-David

----- Original Message ----- 
From: "Jacob Wilson" 
To: "Struts Users Mailing List" 
Sent: Friday, January 23, 2004 12:30 PM
Subject: JSP to static html...


> Hi All...
>
> I have a specific requirement in my project... I want to convert the JSP
pages to static html pages and save them in a local directory... How do I
achieve this functionality??? Any suggestions appreciated.
>
> Thanks much.
>
> -Jacob
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free web site building tool. Try it!


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!

Re: JSP to static html...

Posted by David Erickson <de...@cmcflex.com>.
I don't know the layouts of your jsps or what you are doing in them.. but
JSP's are inherently non-static because they use runtime expressions to
generate the html, and that can change on a per request basis.  If you are
using strictly html and no RT expressions or tags or anything I don't see
why you couldnt just rename the extension from jsp to html and save it
wherever you want.
-David

----- Original Message ----- 
From: "Jacob Wilson" <st...@yahoo.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Friday, January 23, 2004 12:30 PM
Subject: JSP to static html...


> Hi All...
>
> I have a specific requirement in my project... I want to convert the JSP
pages to static html pages and save them in a local directory... How do I
achieve this functionality??? Any suggestions appreciated.
>
> Thanks much.
>
> -Jacob
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free web site building tool. Try it!


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: JSP to static html...

Posted by Max Cooper <ma...@maxcooper.com>.
Jacob,

It sounds like your requirements preclude doing this at build time. I assume
having the button to ftp a static HTML version of the report to a server
somewhere means that the report has some parameters to customize the report,
or at least that the report should be run at the time the user clicks the
button (even if there is no configuration of the report itself).

In that case, it seems like you could have the server make a request to
itself and then save the response (HTML generated by executing the JSP) in a
file or just stream it directly to the ftp server that is waiting to receive
it. I don't have any magic tips about converting JSP to HTML -- I would just
let the server execute the JSP to convert it to HTML. If you need to strip
things out (JavaScript, etc.) you may need to create a new JSP or manipulate
the response to remove that stuff.

-Max

----- Original Message ----- 
From: "Jacob Wilson" <st...@yahoo.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Friday, January 23, 2004 3:58 PM
Subject: Re: JSP to static html...


>
> Thanks Max. This sounds very good. Your saying that automatically creating
an html when the jsp is rendered sounds good. This should solve my problem.
We are using websphere 5.0.  We are not using ant though...
>
> If you can give me little more details on the configuration stuff and how
to specify a particular jsp to be converted into an html, that would be
great...
>
> -Jacob
>
> Max Cooper <ma...@maxcooper.com> wrote:
> View Source ... Save As works generally, but browsers sometimes mess with
> the HTML in subtle ways (netscape used to add an HTML tag, for
> instance), so I would be very wary of using that technique (diff users
> w/diff browser, changes after browser upgrade, etc.). The command-line
tools
> curl or wget should be more trustworthy to deliver the HTML as delivered
by
> the server with no molestation.
>
> If you want to automate the process (which I highly recommend if you are
> really going to do this), you could use Ant to deploy your app and its
JSPs
> on a server and then make requests for all of the pages, saving the
> responses as build output.
>
> Before doing any of this, I would take a detailed look at why you want to
> render your JSPs and convert them to HTML. It seems likely that there is a
> better (easier) way to achieve the intended goal. Ant and its various
> filtering, token-replacing and other abilities may offer a more manageable
> solution.
>
> -Max
>
> ----- Original Message ----- 
> From: "Ron Day"
> To: "Struts Users Mailing List"
> Sent: Friday, January 23, 2004 2:28 PM
> Subject: RE: JSP to static html...
>
>
> > View source in browser and save it to xxx.html
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free web site building tool. Try it!


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: JSP to static html...

Posted by Jacob Wilson <st...@yahoo.com>.
Thanks Max. This sounds very good. Your saying that automatically creating an html when the jsp is rendered sounds good. This should solve my problem. We are using websphere 5.0.  We are not using ant though...
 
If you can give me little more details on the configuration stuff and how to specify a particular jsp to be converted into an html, that would be great...
 
-Jacob

Max Cooper <ma...@maxcooper.com> wrote:
View Source ... Save As works generally, but browsers sometimes mess with
the HTML in subtle ways (netscape used to add an HTML tag, for
instance), so I would be very wary of using that technique (diff users
w/diff browser, changes after browser upgrade, etc.). The command-line tools
curl or wget should be more trustworthy to deliver the HTML as delivered by
the server with no molestation.

If you want to automate the process (which I highly recommend if you are
really going to do this), you could use Ant to deploy your app and its JSPs
on a server and then make requests for all of the pages, saving the
responses as build output.

Before doing any of this, I would take a detailed look at why you want to
render your JSPs and convert them to HTML. It seems likely that there is a
better (easier) way to achieve the intended goal. Ant and its various
filtering, token-replacing and other abilities may offer a more manageable
solution.

-Max

----- Original Message ----- 
From: "Ron Day" 
To: "Struts Users Mailing List" 
Sent: Friday, January 23, 2004 2:28 PM
Subject: RE: JSP to static html...


> View source in browser and save it to xxx.html


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!

Re: JSP to static html...

Posted by Max Cooper <ma...@maxcooper.com>.
View Source ... Save As works generally, but browsers sometimes mess with
the HTML in subtle ways (netscape used to add an HTML <base> tag, for
instance), so I would be very wary of using that technique (diff users
w/diff browser, changes after browser upgrade, etc.). The command-line tools
curl or wget should be more trustworthy to deliver the HTML as delivered by
the server with no molestation.

If you want to automate the process (which I highly recommend if you are
really going to do this), you could use Ant to deploy your app and its JSPs
on a server and then make requests for all of the pages, saving the
responses as build output.

Before doing any of this, I would take a detailed look at why you want to
render your JSPs and convert them to HTML. It seems likely that there is a
better (easier) way to achieve the intended goal. Ant and its various
filtering, token-replacing and other abilities may offer a more manageable
solution.

-Max

----- Original Message ----- 
From: "Ron Day" <ro...@ronday.cc>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Friday, January 23, 2004 2:28 PM
Subject: RE: JSP to static html...


> View source in browser and save it to xxx.html


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: JSP to static html...

Posted by Mark Lowe <ma...@talk21.com>.
wget or curl


On 23 Jan 2004, at 22:28, Ron Day wrote:

> View source in browser and save it to xxx.html
>
> -----Original Message-----
> From: Jacob Wilson [mailto:strutsjo@yahoo.com]
> Sent: Friday, January 23, 2004 1:31 PM
> To: Struts Users Mailing List
> Subject: JSP to static html...
>
>
> Hi All...
>
> I have a specific requirement in my project... I want to convert the 
> JSP
> pages to static html pages and save them in a local directory... How 
> do I
> achieve this functionality??? Any suggestions appreciated.
>
> Thanks much.
>
> -Jacob
>
>
> ---------------------------------
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free web site building tool. Try it!
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: JSP to static html...

Posted by Ron Day <ro...@ronday.cc>.
View source in browser and save it to xxx.html

-----Original Message-----
From: Jacob Wilson [mailto:strutsjo@yahoo.com]
Sent: Friday, January 23, 2004 1:31 PM
To: Struts Users Mailing List
Subject: JSP to static html...


Hi All...

I have a specific requirement in my project... I want to convert the JSP
pages to static html pages and save them in a local directory... How do I
achieve this functionality??? Any suggestions appreciated.

Thanks much.

-Jacob


---------------------------------
Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org