This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Struts and the fly likes Regarding velocity template and also sending the mail using this Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "Regarding velocity template and also sending the mail using this" Watch "Regarding velocity template and also sending the mail using this" New topic
Author

Regarding velocity template and also sending the mail using this

issak madeena Rahamatullah
Greenhorn

Joined: Jan 24, 2012
Posts: 1
i am using velocity templates in struts , is there any configurations required in struts, please help me
ArrayList list = new ArrayList();
Map map = new HashMap();
map.put("FromAddress", from);
map.put("ToAddress", to);
map.put("ReportingManager", reportingmanageraddress);
map.put("Subject", subject);
list.add(map);

VelocityContext context = new VelocityContext();
context.put("mail", list);
Template t = ve.getTemplate( "./src/email_html.vm" );
StringWriter writer = new StringWriter();

t.merge( context, writer );
System.out.println( writer.toString() );

then how to send mails by using this template
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Regarding velocity template and also sending the mail using this
 
Similar Threads
Velocity Templates with Servlets
Velocity with localization
Velocity Error:Resource Not Found Exception
Velocity Template is not encoding charecter,instead throwing an error message.
Velocity Templates with Servlets