This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin 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 ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

Jsp to html  RSS feed

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a way, a method or a class in jsp api's to convert the jsp file into html file. The reason is lot of data is dynamically generated in the jsp file, i need to use this and convert it into html file and attach that file into my email. Is there a way to do this? If not found in jsp api's, is there any other way to do this?
Thank you,
Appreciated your response on this.
 
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mandy
A JSP is desinged to send data to the browser in the form of HTML, not to neccesarily create an HTML file. To do something like that you could have a servlet or a bean process the data and just generate a file that can be included in an email.
 
Mandy S Smith
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Dave for your quick reply. I understand what you are saying, but thought there could be something simple that could write out just the html stuff.
I might have to end up doing like what you mentioned, to write out all the stuff using a servlet or some class into a file, which can used as an attachment file.
Thank you.
 
Dave Vick
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Mandy S Smith:
... something simple that could write out just the html stuff.


I'm not sure what you mean by write it out? In order to attach it to an email it needs to be in a separate file. If you mean to write the html directly into the email then you might want to look at the javaMail API. I've not worked with it myself but it should be a fairly easy thing to create the message content to include HTML tags.
 
Mandy S Smith
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a Email class(Uses JAVA MAIL) which can handle html tags in its body. What i meant by writing out is , either i can write the html tags into a separate file or append to a stringBuffer and pass it on to my email class.
Thanks.
 
Without subsidies, chem-ag food costs four times more than organic. Or this tiny ad:
Programmatically Create PDF Using Free Spire.PDF with Java
https://coderanch.com/wiki/703735/Programmatically-Create-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!