Hi,
I am looking for a way to have a
Servlet (my container is
Tomcat) calling a
JSP file and processing it in order to retrieve the generated HTML.
The compete scenario:
I have virtual shop and whenever a purchase is being carried out, the customer is redirected to a Servlet that post-processes the purchase (thank you, list of the items, etc.)
Among all these, the Servlet is also supposed to send me an email about the new purchase.
I would like to have nice designed HTML mail and not just a simple plain text notification.
I thought of having a designated JSP as a view, and it will only be available from the Servlet container, for this purpose.
One way is having the Servlet create an HTTPClient (or any other method of network communication) to my own host and ask for the JSP.
I wonder if there is a simpler way to ask my own container to process a JSP, since I am not really making a request to an outside web application.
Something like
getServletContext.processAndReturnJsp("mail.jsp")
BTW, if you think my approach is too cumbersome to fill an email with HTML code, it would be great to know of a simpler way.
Thanks,
Guy