This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Sending JSP rendered html email from a Servlet

 
elnah
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am adding �email this page functionality� to an existing jsp/servlets based website. I can send html content without issue as long as it is written into the servlet sending the email. Is there a simple method for including the rendered html output from a jsp as the body of the html email? Or am I forced to reproduce the jsp pages as html for email? Any help would be appreciated as this seems like a problem that someone must have solved.

Thanks in advance.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"elnah",
Welcome to JavaRanch!

We're pleased to have you here with us in the Servlets forum, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks,
Jeanne
Forum Bartender
[ November 04, 2004: Message edited by: Jeanne Boyarsky ]
 
Jeroen Wenting
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can start an HTTP request to the JSP from your servlet and capture the output stream of the JSP into your email.
You will have to figure out a way to strip the HTTP headers yourself, but that's easy. Hint: what does every HTML document start with?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic