You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by Colin Chalmers <co...@maxware.nl> on 2001/07/13 08:57:44 UTC

file.resource.loader.path

Hi all,

I was playing about with Velocity and noticed the following which someone may be able to help with.

>From what I see and understand the path to the template directory is set by the "file.resource.loader.path" which appears to be relative to thje servlet runner ie /templates.

On windoos I have been able to set an extra path to "e:/templates" but when I try something similiar on Unix ie "/opt/test/templates" the templates cannot be found. Presumably because of the path beginning with "/" and Velocity looking for a relative path?? Is there a way to work around for this so that I can set an absolutepath under Unix not relative to the servlet runner?

Cheers

/Colin

Re: file.resource.loader.path

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Colin Chalmers wrote:
> 
> Hi all,
> 
> I was playing about with Velocity and noticed the following which someone may be able to help with.
> 
> >From what I see and understand the path to the template directory is set by the "file.resource.loader.path" which appears to be relative to thje servlet runner ie /templates.
> 
> On windoos I have been able to set an extra path to "e:/templates" but when I try something similiar on Unix ie "/opt/test/templates" the templates cannot be found. Presumably because of the path beginning with "/" and Velocity looking for a relative path?? Is there a way to work around for this so that I can set an absolutepath under Unix not relative to the servlet runner?
> 

It depends - Velocity itself will use an absolute path, or in the event
you don't give it one, look for templates relative to the 'current
directory'.

If you are using the servlet examples, take a look at both
servlet_example1 and servlet_example2 - they show to variants on the
problem - #2 uses the servlet container to let you specify template
paths relative to the webapp root... in the other, you would use an
absolute path.

geir

-- 
Geir Magnusson Jr.                           geirm@optonline.net
System and Software Consulting
Developing for the web?  See http://jakarta.apache.org/velocity/
You have a genius for suggesting things I've come a cropper with!