You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Neha Vishwarupe <nv...@collab.net> on 2008/06/05 23:46:54 UTC

Question on reloading Velocity Templates

Hi,

 

I want to reload a Velocity template. A template of same name exists
under 2 locations. If first one fails - throws exception then I want to
load another one of same name. Problem is Velocity is already
initialized to multiple paths of directories to look for templates using
properties.  Following would be one path and other one is default path
under classes\

 

props.put(Velocity.FILE_RESOURCE_LOADER_PATH, ....

 

 

So how to distinguish at run time which full path should be used to load
other  velocity template with same name?

 

 

Thanks

Neha 

 

 


Re: Question on reloading Velocity Templates

Posted by Nathan Bubna <nb...@gmail.com>.
I'm not sure i understand the question here.  What is the behavior you
are currently experiencing with your setup.  Are you using two
different resource loaders or two paths for the same resource loader?
Both can be done.  The order you configure them in is the order of
lookup.  So, if you do:

resource.loader = file, class

it will check the "file" loader before the "class" one.  if you have
multiple paths for one loader, then, again, it searches them in the
order you list them.

not sure if this info helps...

On Thu, Jun 5, 2008 at 2:46 PM, Neha Vishwarupe <nv...@collab.net> wrote:
> Hi,
>
>
>
> I want to reload a Velocity template. A template of same name exists
> under 2 locations. If first one fails - throws exception then I want to
> load another one of same name. Problem is Velocity is already
> initialized to multiple paths of directories to look for templates using
> properties.  Following would be one path and other one is default path
> under classes\
>
>
>
> props.put(Velocity.FILE_RESOURCE_LOADER_PATH, ....
>
>
>
>
>
> So how to distinguish at run time which full path should be used to load
> other  velocity template with same name?
>
>
>
>
>
> Thanks
>
> Neha
>
>
>
>
>
>

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