KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am developing an application for OSGi with velocity template engine. It works great for loading my templates by file loader but now I have to implement this templates in my jar and load it as resources. How can i made it work? My Code: ve = new VelocityEngine(); ve.setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath"); ve.setProperty("classpath.resource.loader.class", ClasspathResourceLoader.class.getName()); ve.setProperty("classpath.resource.loader.path", "/velocitytemplates"); ve.init(); ve.getTemplate("foo.vm"); This will throw an exception like Unable to find resource 'index.vm' Caused by: org.apache.velocity.exception.ResourceNotFoundException: Unable to find resource 'index.vm'
Tags (comma-separated)
Save Edits
Cancel