You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Keng Onn <ke...@pendulab.com> on 2005/08/15 04:05:27 UTC
Configuring file loader path
Hi,
I'm trying to use Velocity within my web application to generate some
text files, but while configuring Velocity using the
"velocity.properties" file, I've some problem in configuring the file
resource loader path to point to "...WEB-INF\myapp" where my templates
(e.g. "source.vm") are located, i.e. "myapp" folder within "WEB-INF".
The actual velocity.properties file I'm using contains the following lines:
===
resource.loader = file
file.resource.loader.description = Velocity File Resource Loader
file.resource.loader.class =
org.apache.velocity.runtime.resource.loader.FileResourceLoader
file.resource.loader.path = .
file.resource.loader.cache = false
file.resource.loader.modificationCheckInterval = 2
===
I've tried setting "file.resource.loader.path" to "/WEB-INF/myapp",
"WEB-INF/myapp", but all to no avail :(.
Does anyone have any idea how to resolve this issue? Any help would be
very much appreciated...
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org
Re: Configuring file loader path
Posted by Nathan Bubna <nb...@gmail.com>.
you should try using the WebappLoader instead of the
FileResourceLoader. it's in the VelocityTools project. the
VelocityViewServlet uses it to make resource loading in webapp
environments much easier. it should likewise make it easier on you.
On 8/14/05, Keng Onn <ke...@pendulab.com> wrote:
> Hi,
>
> I'm trying to use Velocity within my web application to generate some
> text files, but while configuring Velocity using the
> "velocity.properties" file, I've some problem in configuring the file
> resource loader path to point to "...WEB-INF\myapp" where my templates
> (e.g. "source.vm") are located, i.e. "myapp" folder within "WEB-INF".
>
> The actual velocity.properties file I'm using contains the following lines:
> ===
> resource.loader = file
> file.resource.loader.description = Velocity File Resource Loader
> file.resource.loader.class =
> org.apache.velocity.runtime.resource.loader.FileResourceLoader
> file.resource.loader.path = .
> file.resource.loader.cache = false
> file.resource.loader.modificationCheckInterval = 2
> ===
>
> I've tried setting "file.resource.loader.path" to "/WEB-INF/myapp",
> "WEB-INF/myapp", but all to no avail :(.
>
> Does anyone have any idea how to resolve this issue? Any help would be
> very much appreciated...
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org