WebWork with Velocity templates…
Finally I was able to configure WebWork in order to properly find the Velocity templates.Here is how my webwork.properties extract looks like:
runtime.log.invalid.references = true
resource.loader = file, class, devel_work
resource.manager.logwhenfound = false
velocimacro.library=WEB-INF/classes/webwork.vm
file.resource.loader.path = /
class.resource.loader.class = org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
class.resource.loader.cache = true
class.resource.loader.modificationCheckInterval = 0
devel_work.resource.loader.path = /development/kalixiashop/src/webapp
devel_work.resource.loader.cache = true
devel_work.resource.loader.modificationCheckInterval = 1What is really important to understand is that if you want to use your templates packaged in the WAR, you have to use:
file.resource.loader.path = /I spent a lot of time wondering what was happening and finally understood that even though Velocity does not care about the name of the loader (in this case file), the WebWork servlet does! So do not try to do something like this, it won't work:
resource.loader = war, class, devel_work
resource.manager.logwhenfound = false
velocimacro.library=WEB-INF/classes/webwork.vm
war.resource.loader.path = /
class.resource.loader.class = org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
class.resource.loader.cache = true
class.resource.loader.modificationCheckInterval = 0
devel_work.resource.loader.path = /development/kalixiashop/src/webapp
devel_work.resource.loader.cache = true
devel_work.resource.loader.modificationCheckInterval = 1