You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Timothy Shadel <sh...@mtc.byu.edu> on 2001/11/14 22:41:44 UTC

Dynamic Email

Hi,

I'd like to generate dynamic e-mail content, typically based on some parameters stored in the current HttpSession.  JSP seems like a great tool for this.  I can easily edit the "static" portion of the e-mail, and have non-technical personnel work with it.  I'd get all the advantages JSP gives to dynamic HTML generation.  I can't seem to figure out a good way to do it, though.  I've tried to use the RequestDispactcher.include(), but there's no way to change the OutputStream to recover the content that was inadvertently streamed to the browser.  I can't wrap the request/response objects in the Servlet 2.2 spec (tomcat 3.x), and I'm not sure I'd know the details of how to even if I was running tomcat 4.0.  I tried creating a URL and calling getContent(), which returns a PushbackInputStream, but this works only sporadically.  Most of the time the buffer has been read completely, and I have no data with which to push it back.  All I want to do is load a JSP page, ensure that it's processed within the current Session and Request (so it has access to the needed variables), and then push that content into an e-mail message that I send using the JavaMail API.

I assume that somebody else has wanted this type of thing before.  If there's another solution to let end-users easily edit the static surroundings of dynamic e-mail content, where I can use templates, internationalization, and other great tools as easily as Struts, please let me know.

Thanks,

Tim


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>


RE: Dynamic Email

Posted by Kevin McBrearty <ke...@atg.ca>.
Check out Velocity at apache.org

Kevin McBrearty
ATG Automation Technologies Group Ltd.
______________________________________

"A computer lets you make mistakes faster than any other invention in human
history, with the possible exception of handguns and tequila." - D.W.
McArthur

> -----Original Message-----
> From: Timothy Shadel [mailto:shadeltd@mtc.byu.edu]
> Sent: Wednesday, November 14, 2001 4:42 PM
> To: tomcat-user@jakarta.apache.org
> Subject: Dynamic Email
>
>
> Hi,
>
> I'd like to generate dynamic e-mail content, typically based on
> some parameters stored in the current HttpSession.  JSP seems
> like a great tool for this.  I can easily edit the "static"
> portion of the e-mail, and have non-technical personnel work with
> it.  I'd get all the advantages JSP gives to dynamic HTML
> generation.  I can't seem to figure out a good way to do it,
> though.  I've tried to use the RequestDispactcher.include(), but
> there's no way to change the OutputStream to recover the content
> that was inadvertently streamed to the browser.  I can't wrap the
> request/response objects in the Servlet 2.2 spec (tomcat 3.x),
> and I'm not sure I'd know the details of how to even if I was
> running tomcat 4.0.  I tried creating a URL and calling
> getContent(), which returns a PushbackInputStream, but this works
> only sporadically.  Most of the time the buffer has been read
> completely, and I have no data with which to push it back.  All I
> want to do is load a JSP page, ensure that it's processed within
> the current Session and Request (so it has access to the needed
> variables), and then push that content into an e-mail message
> that I send using the JavaMail API.
>
> I assume that somebody else has wanted this type of thing before.
>  If there's another solution to let end-users easily edit the
> static surroundings of dynamic e-mail content, where I can use
> templates, internationalization, and other great tools as easily
> as Struts, please let me know.
>
> Thanks,
>
> Tim
>
>
> --
> To unsubscribe:   <ma...@jakarta.apache.org>
> For additional commands: <ma...@jakarta.apache.org>
> Troubles with the list: <ma...@jakarta.apache.org>
>


--
To unsubscribe:   <ma...@jakarta.apache.org>
For additional commands: <ma...@jakarta.apache.org>
Troubles with the list: <ma...@jakarta.apache.org>