on 08-12-2011 2:17 PM
Hello,
We use Apache velocity to send emails in our portal application. We package the appliaction as a PAR and deploy it oin Netweaver 7.0. An iview is created from the deployed par to display the application.
My problem is that the velocity engine is not able to find the template in the par file.
Exception is:
org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'email_template.vm'
My code is like below.
Template t = velocityEngine.getTemplate( "email_template.vm" );
I have put the vm file under classes folder in PORTAL-INF
Can any one suggest a solution?
Regards,
PJ
Resolved by providing proper init params to use in a webapp scenario.
Properties prop = new Properties();
prop.setProperty("resource.loader","classpath"); prop.setProperty("classpath.resource.loader.class","org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
ve.init(prop);
PJ
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.