This week's book giveaways are in the Jython/Python and Object-Oriented programming forums.
We're giving away four copies each of Machine Learning for Business: Using Amazon SageMaker and Jupyter and Object Design Style Guide and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming forum!
  • 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
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Joe Ess
  • salvin francis
  • fred rosenberger

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
Can't .... do .... plaid .... So I did this tiny ad instead:
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!