commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ferindo Middleton <>
Subject [email] embed/include parsed JSP page file in email HTML body
Date Sun, 08 Aug 2010 21:28:08 GMT
I'm using Class HtmlEmail.  Is there a way to embed a parsed JSP page in the
email message body. I use Tomcat and Java Server Pages. In my JSP pages I
can do something like: <%@ include file="ticket_email_response_body.jsp" %>
and want to be able to included this processed .jsp file in the body of the
text message.

I've looked at the examples in the documentation for embedding Files and
images and I've tried the following example code but it doesn't embedded the
actual parsed .jsp into the image. It includes the file as an attachment and
puts the text string of the quoted text in the body of the message:

 File ticketEmailResponseBody = new
 StringBuffer msg = new StringBuffer();
 msg.append("<%@ include file=\"webapps/utrad/web/header.jsp\" %>");
 msg.append("<%@ include
file=").append(email.embed(ticketEmailResponseBody)).append(" %><BR><BR>");

 URL emailBodyURL = new URL("
 String pid = email.embed(emailBodyURL,
 msg.append("<BR><BR>try the above code again a different way:<BR> <%@
include file=\"" + pid + "\" %><BR>- Ferindo<BR><BR>");


none of the "appends" I use above end up including the .jsp page as parsed
data in the body of the email/not even the raw unparsed text is included in
the message body. Looking at the logs, it looks like it's included the raw
text content of the JSP file (unparsed) but it doesn't include the text in
the body of the email, just the following:
<%@ include file="webapps/utrad/web/header.jsp" %><%@ include
file=ekzvyazwil %>

...and it included two of the .jsps in the message above as attachments
instead, not exactly what I was trying to do.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message