#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Posts
    6
    Rep Power
    0

    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. #2
  3. No Profile Picture
    Clueless llama
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Feb 2001
    Location
    Lincoln, NE. USA
    Posts
    2,353
    Rep Power
    117
    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.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2002
    Posts
    6
    Rep Power
    0
    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
  6. #4
  7. Modding: Oracle MsSQL Firebird
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2001
    Location
    Outside US
    Posts
    8,527
    Rep Power
    538

IMN logo majestic logo threadwatch logo seochat tools logo