Thank you for your reply. Unfortunately, it is not clear for me yet how to use the classpath loader or the webapp loader. I have tried doing something like:

VelocityEngine velocityEngine = new VelocityEngine();
      Properties prop = new Properties();
      prop.setProperty("resource.loader", "class");
prop.setProperty("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
      velocityEngine.init(prop);

but the template still cannot be located. My application is a J2EE application, so its structure is something like: src/main/java/pojos/TemplateUtils(contains the code above), src/main/java/mypackage/statelessBean(uses TemplateUtils) and src/resources/META-INF/mytemplate.vm. The application jar package and the velocity jar package are placed inside an ear package that is deployed in jboss. I have tried all the ways that I could think of for setting the path to mytemplate.vm and still couldn't make it work. So it is not clear for me where Velocity starts looking for template; the documentation says in the current working directory, but what is this? Is it important that my application is packaged in a jar file(java classes and the templates) and it references the velocity engine that is located in another jar package?

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

Reply via email to