• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Save JSP output as.html

Ranch Hand
Posts: 3640
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We have an upload module that enable site operator to upload news in CSV format.

“NewsTitle, NewsDate, NewsDescription”

After uploading news details in database, site operator can view all uploaded news alone with the existing news. If he wants to display uploaded news on the site or want to remove any existing news from displaying, just need to check/uncheck checkbox against the particular news and database will have corresponding updates when site operator saves form.

We have JSP page that make query to database and display the news that are marked to be displayed.

We upload news end of the day.

Information displayed by JSP page is same for whole day, but still it is making query to the database. We can catch the content in application sever by many ways, but still JSP page will be rendered the each time it has new request.

If I am able to generate .html page with the content of output generated by JSP page, it will have faster for user. I can make a provision that, whenever site operator uploads news, generate new .html file with the output of JSP file and overwrite the existing.

Now my question is, how to generate .html page from the output generated by JSP page?
Ranch Hand
Posts: 2596
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wharver contents JSP is generating can be written to an HTML fiel by simple I/O, you may use a servlet as well. Do embed date in the name of HTML file, so any request to JSP page will check for existance of this HTML file, if present redirect to this file, if not do DB query and generate HTML file and then redirect.

You may also want to write a small script to do clean-up of those HTML files in a regular basis. looks straight-forward to me.

- Manish
When all four tires fall off your canoe, how many tiny ads does it take to build a doghouse?
the value of filler advertising in 2020
    Bookmark Topic Watch Topic
  • New Topic