cancel
Showing results for 
Search instead for 
Did you mean: 

Velocity template in portal application

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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