Win a copy of The Journey To Enterprise Agility this week in the Agile and Other Processes forum! And see the welcome thread for 20% off.
  • 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:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Junilu Lacar
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Ganesh Patekar
  • Tim Moores
  • Pete Letkeman
  • Stephan van Hulst
Bartenders:
  • Carey Brown
  • Tim Holloway
  • Joe Ess

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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!