dcsimg
sending jsp page as html attachment using javamail
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   lisa_sershen
Posted On:   Thursday, March 28, 2002 01:11 PM

How do you send a jsp page as an html attachment using javamail?

Basically, the way that send page works from the browser.

Is this possible?? If so..can you please give code examples or resources.

I have searched the FAQs and can not find anything on how to do this.

Thanks in advance!

Re: sending jsp page as html attachment using javamail

Posted By:   Bob_Lee  
Posted On:   Thursday, March 28, 2002 01:23 PM

You have to capture the output of the JSP page.



If this is from generic Java code, make a connection to your server and capture the page. The HttpClient package in the Jakarta Commons project may be helpful.



If this is from another Servlet or JSP, you can pass a wrapped response (created using HttpResponseWrapper) to a RequestDispatcher.include() and capture then JSP output to a StringWriter or ByteArrayOutputStream.



In either case, just attach the output as an HTML attachment.

About | Sitemap | Contact