Feb 26 2009
Sending email with Spring and Velocity
Usage: the action class
In my case, I use my email service in a struts action class:
JAVA:
-
public class MyAction
-
extends ActionSupport
-
implements Preparable ,ValidationAware{
-
//spring injected
-
private EmailService emailService;
-
-
List<string> recipients = new ArrayList<string>();
-
recipients.add(myObject.getEmail());
-
Map<string,object> params = new HashMap<string,>();
-
params.put("user", user);
-
emailService.sendEmail(validationMessage, recipients, params);
-
}</string,></string,object></string></string>
-
-
}



reading this article is like pain in the ass. please next time split such article into 20 pages, 7 is not enought