Hi,

my deployment is also packaged into jar file under WEB-INF/lib, except i
don't have the templates directory,  in my case the *.vm files are in the
place where log4j.properties is, try to move those *.vm files into that
place and see if velocity can find it.

a.c.


MoritzGilsdorf wrote:
> 
> Then I get:
> 
> org.apache.velocity.exception.ResourceNotFoundException: Unable to find
> resource 'description.vm'
> 
> Obviously Velocity can't find the template because in my deployment it is
> packaged in the jar file under WEB-INF/lib .
> 
> 
> Angelo Chen wrote:
>> 
>> how about just :
>> 
>> emplate template = Velocity.getTemplate("description.vm");
>> 
>> 
>> MoritzGilsdorf wrote:
>>> 
>>> Hi,
>>> 
>>> I have that. Here is my code:
>>> 
>>> props.setProperty(VelocityEngine.RESOURCE_LOADER, "classpath");
>>> props.setProperty("classpath." + VelocityEngine.RESOURCE_LOADER +
>>> ".class",ClasspathResourceLoader.class.getName());
>>> engine.init(props);
>>> 
>>> Then I load my template with this:
>>> 
>>> Template template =
>>> Velocity.getTemplate("src/main/resources/templates/description.vm");
>>> 
>>> But this location is not in my .war file. Is there maybe something like
>>> the Path Annotation for Assets to get a reliable path?
>>> 
>>> Moritz
>>> 
>>> 
>>> 
>> 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/T5%3A-Using-resources-tp15618690p15630128.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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

Reply via email to