Esteve Camps Chust wrote:
hi all,

this is my first email at struts list. I am a new user to struts2. I'm
trying to get working the next scenario: having a mailer class, I want the
message text be a rendered JSP. The action class calls a mailer class; this
composes the mail from the rendering result of a jsp element (it would be
fantastic that this rendering process uses some action class
attributes/values). Finally, the action class informs the user about the
mailing result.

Is there any way to get this working? I think I did it once on struts 1.3 :(

Thanks in advance.

Sincerely,

Esteve


Yes it can be done, but my suggestion is to NOT use a JSP as the source of the message text. Instead use a template engine like FreeMarker or Velocity and write the source of the message in HTML+templateLanguage. That'll allow you to build and test the mailer outside the J2EE environment which is much more productive (and in the case of FTL, superior)

With this approach, your action class will simply be responsible for creating a context for the template (eg. a Map), invoking the emailer and then returning a happy result (JSP) for the user.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to