August 9th, 2002, 03:01 AM
from dynamic jsp page to static...
This might be obvious, and to be honest whenever thinking about it before I thought it would be simple... how can I get my dynamic pages to generate flat html files (unique versions so each time they are 'processed' it might be file1.html, next file2.html etc.)?
At the moment my controller fowards its request, response (via dispatcher) to a jsp file which is then built from previously entered data stored in objects and kept in the users session. I need to be able to generate a static html version of this. I have tried using java.net.Url.openStream() and sending this to a BufferedReader, however tomcat then gives errors about not being able to instantiate my stored session objects...
Does anybody know of a better way to do this, I have tried to search for clues (large sites generally want flat files to reduce server load so i thought it wouldnt be too hard to find)...
Hope this is clear, thanks for any help
August 10th, 2002, 02:43 PM
Not quite sure what you are trying to accomplish. I could only see this as feasible if the data for the page changes so little (once a week) or the site has a huge hit count. However, if the trigger for the html file creation is someone requesting a link to a jsp, then how do you think you are going to save server resources by generating an html file?
If you think that generating an html file in your controller and then forwarding it to the html file is going to save you resources over forwarding it directly to a jsp (that essentially does the same thing), I believe you are mistaken.
August 10th, 2002, 10:19 PM
my client wants a hard copy (record) of each change made to the page, so instead of storing each version in a database i also create flat html files that dont have to be used within the web - containter...
i was only referring to large sites (mostly using a cms of some kind) that generate flat files, which will definately reduce load on the server
thanks for your reply. any other ideas or suggestions more than welcome
August 11th, 2002, 03:06 AM