You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Garey Mills <gm...@library.berkeley.edu> on 2013/02/20 00:41:27 UTC

Problems finding template

Hello -

     I am writing a web app that starts a thread to perform some 
operations that take too much time to require the user to wait for them.

     In that thread, I am trying to use Velocity to write out some data 
into a template. I start a VelocityEngine, init it, create a Velocity 
Context
and then call mergeTemplate.  The problem is that I am at a loss about 
how to specify the location of the template. I have it in a directory
called 'templates' in the root directory of my web app, but neither 
'/templates/<template>' or 'templates/<template> works. Investigating
a little, I find that the current working directory is in tomcat's bin 
directory.

     Is there somewhere to specify where Velocity Engine should look for 
templates?

-- 
Garey Mills
Library Systems Office
UC Berkeley


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


Re: Problems finding template

Posted by Nathan Bubna <nb...@gmail.com>.
http://velocity.apache.org/engine/devel/developer-guide.html#Configuring_Resource_Loaders

On Tue, Feb 19, 2013 at 3:41 PM, Garey Mills
<gm...@library.berkeley.edu> wrote:
> Hello -
>
>     I am writing a web app that starts a thread to perform some operations
> that take too much time to require the user to wait for them.
>
>     In that thread, I am trying to use Velocity to write out some data into
> a template. I start a VelocityEngine, init it, create a Velocity Context
> and then call mergeTemplate.  The problem is that I am at a loss about how
> to specify the location of the template. I have it in a directory
> called 'templates' in the root directory of my web app, but neither
> '/templates/<template>' or 'templates/<template> works. Investigating
> a little, I find that the current working directory is in tomcat's bin
> directory.
>
>     Is there somewhere to specify where Velocity Engine should look for
> templates?
>
> --
> Garey Mills
> Library Systems Office
> UC Berkeley
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>

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