Am 08.07.2010 15:44, schrieb ch...@chrismiles.org:
Thanks yeah I see what you mean. It would be easy to have a class generate tons of HTML but that would be cumbersome. Getting the resuling rendered JSP would be something tricky.
Yes, tricky indeed, but currently the only way to go. Our own app has this capability. But since it is closed source, commercial and everything, i will not share the source with you. I'll tell you so much, however: Research how to program your own ServletResponse class that captures the output written to it somewhere. Then use this custom response to have a request dispatcher for your JSP write to. After this, grab the resulting HTML from your response and create a correctly formatted HTML multipart mail from it (see the JavaMail API for details about how to do this).
The other remarks about JavaScript, absolute URLs, forms (iframes, ....) of course still apply and you need to deal with this somehow. Oh, and BTW, don't forget to have a suitably written plain text alternative. Where do you get that from? Created from the HTML (yuck, trust me!)? Or supplied elsewhere?
To summarize: Your approach to use a JSP to define the HTML part of an email sounds good at first glance, but there is a lot to consider! (Which in no way is related to Struts...)
Robert --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org