ResourceLoader to load templates from multiple Jar files.
The configuration of the JarResourceLoader is straightforward -
You simply add the JarResourceLoader to the configuration via
resource.loader = jar
jar.resource.loader.class = org.apache.velocity.runtime.resource.loader.JarResourceLoader
jar.resource.loader.path = list of JAR <URL>s
So for example, if you had a jar file on your local filesystem, you could simply do
jar.resource.loader.path = jar:file:/opt/myfiles/jar1.jar
Note that jar specification for the .path configuration property
conforms to the same rules for the java.net.JarUrlConnection class.
For a working example, see the unit test case,
org.apache.velocity.test.MultiLoaderTestCase class
author: Aki Nieminen author: Dave Bryson version: $Id: JarResourceLoader.java 471259 2006-11-04 20:26:57Z henning $ |