|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
from dynamic jsp page to static...
Hi there
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 |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
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 ![]() |
|
#4
|
||||
|
||||
|
I'm reading this interesting tutorial about writing to a file, maybe it can help you http://sylistron.org/tutorial/files/index.html
__________________
My blog about OpenSource Databases PDF tutorials about OSS databases, DBMonster ... Please contribute to Open Source Development, fill bug reports!!! Developer Shed eSupport Commented my.ini/my.cnf (PLEASE ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > from dynamic jsp page to static... |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|