Hi,

You need to use the JarResourceLoader instead of the FileResourceLoader.
This should be simply a matter of changing a couple of lines, to
something like:

java.util.Properties oProperties = new Properties();
oProperties.setProperty("resource.loader", "jar");
oProperties.setProperty("jar.resource.loader.path", "c:\\temp\foo.jar");
Velocity.init(oProperties);
Template oTemplate = Velocity.getTemplate("foo.tpl");


Check the Resource Management section in the developer-guide for more
detail.

- simon



Pierre-François Lemosquet wrote:
> 
> Hi!
> 
> I use a template located in c:\temp\foo.tpl
> 
>  java.util.Properties oProperties = new Properties();
>  oProperties.setProperty("file.resource.loader.path", "c:\\temp");
>  Velocity.init(oProperties);
>  Template oTemplate = Velocity.getTemplate("foo.tpl");
> 
> But, how to do to use a template which is located in a jar  ?
>

Reply via email to