You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Endre Rognerud <e....@usit.uio.no> on 2003/02/18 19:18:57 UTC

Defining different resource-paths for every webapps.

Hi!

I have been playing around with a couple of Velocity-based webapps. I have
managed to define the path where Velocity will look for my templates;
typically a folder named 'templates' in the folder for the webapp:

'.../resin-2.1.6/webapps/myapp1/templates'.

This works fine for this webapp, but when I deploy another that should look
for templates in it's own 'templates'-folder, Velocity don't find them. It
seems that my first configuration is not only for my first webapp?

I have tried to understand and setup a 'FileResourceLoader', but I haven't
managed to get different template-folder for each webapp.

Can anybody give me a hint of a nice and easy way to do this?
Thanks!!

--
Endre


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: Defining different resource-paths for every webapps.

Posted by Barbara Baughman <ba...@utdallas.edu>.
If your servlet extends VelocityServlet, you will need a separate Velocity
jar under the WEB-INF/lib directory of each web application.  
VelocityServlet uses a singleton model of Velocity.

You can also extend HttpServlet and initialize a VelocityEngine within it
for template handling.  In this case, you can share a Velocity jar across
the container, because each VelocityEngine keeps track of its own
configuration.

I think it's easier for beginners to extend VelocityServlet.

Barbara Baughman
X2157

On Tue, 18 Feb 2003, Endre Rognerud wrote:

> Hi!
> 
> I have been playing around with a couple of Velocity-based webapps. I have
> managed to define the path where Velocity will look for my templates;
> typically a folder named 'templates' in the folder for the webapp:
> 
> '.../resin-2.1.6/webapps/myapp1/templates'.
> 
> This works fine for this webapp, but when I deploy another that should look
> for templates in it's own 'templates'-folder, Velocity don't find them. It
> seems that my first configuration is not only for my first webapp?
> 
> I have tried to understand and setup a 'FileResourceLoader', but I haven't
> managed to get different template-folder for each webapp.
> 
> Can anybody give me a hint of a nice and easy way to do this?
> Thanks!!
> 
> --
> Endre
> 
> 
> ---------------------------------------------------------------------
> 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