I want to achieve the 2 things at the same time.
I have a regular jsp page in Struts2. xx/yy/zz/email.jsp
<
This is not the answer to your question but I suggest you consider using a template engine to compose your emails, such as Velocity or Jelly
http://velocity.apache.org/
http://commons.apache.org/proper/commons-jelly/
This way you can compose your templates as HTML or XML and inject there any relevant data your logic may have retrieved (and even some logic integrated in their own template languages, such as if-then-else or while-loop structures).
In the very worst case that is completely necessary to render the full JSP, you could hack something on
RequestDispatcher::include
You could execute this method from your MyEmailAction, but passing it a hacked ServletResponse. This would be some class written by you implementing ServletResponse... but writing the result in some ByteArrayOutputStream. After the page is rendered (on your fake ServletResponse) you could just retrieve it from there (actually using the servlet container as your own template engine)