You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "Charles N. Harvey III" <ch...@alloy.com> on 2004/02/19 18:56:10 UTC

multiple resource.managers using VVS

Hello again.
If I define multiple resource.manager (say, webapp and url) and I am using
velocity in a servlet context, then I can choose which resource manager
that I use to retrieve which templates.  Can this be done if I am using VVS?
Most of my templates are in the webapp, but ones that change 3 times a day
make it annoying to re-deploy a webapp all the time.  (we don't have the
best deployment setup here)  So I would like to be able to add the url
resource manager and get a few templates from another machine.

Is this possible?  Thanks for the help.


Charlie


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


Re: multiple resource.managers using VVS

Posted by Geir Magnusson Jr <ge...@4quarters.com>.
On Feb 19, 2004, at 6:03 PM, Charles N. Harvey III wrote:

> Does velocity automatically try the first one then the second?

Yes.

> That's the only part I wasn't sure of.  I thought that I had to
> specify which one came from which place.  But if it tries 1 then
> 2 then I'm all set.

You're set.

>
> Thanks so much for all these tips.
>
>
> Charlie
>
>
> Bill Stilwell wrote:
>
>> Geir Magnusson Jr said:
>>
>>> On Feb 19, 2004, at 1:10 PM, Nathan Bubna wrote:
>>>
>>>
>>>> Charles N. Harvey III said:
>>>>
>>>>> Hello again.
>>>>> If I define multiple resource.manager (say, webapp and url) and I 
>>>>> am
>>>>> using
>>>>> velocity in a servlet context, then I can choose which resource
>>>>> manager
>>>>> that I use to retrieve which templates.  Can this be done if I am
>>>>> using VVS?
>>>>> Most of my templates are in the webapp, but ones that change 3 
>>>>> times
>>>>> a day
>>>>> make it annoying to re-deploy a webapp all the time.  (we don't 
>>>>> have
>>>>> the
>>>>> best deployment setup here)  So I would like to be able to add the 
>>>>> url
>>>>> resource manager and get a few templates from another machine.
>>>>>
>>>>> Is this possible?  Thanks for the help.
>>>>>
>>
>>
>>> Right - just deal w/ it when you configure velocity, like you would 
>>> in
>>> any other scenario
>>>
>>
>> We're currently doing this and it's pretty easy, just configure it in
>> velocity.properties:
>>
>> resource.loader = webapp,file
>> file.resource.loader.description = Velocity File Resource Loader
>> file.resource.loader.class =
>> org.apache.velocity.runtime.resource.loader.FileResourceLoader
>> file.resource.loader.path = /path/to/templates
>> file.resource.loader.cache = true
>> file.resource.loader.modificationCheckInterval = 120
>>
>> I'd recommend that you put whatever resource loader that handles the 
>> most
>> templates go first in the resource.loader line, as it's checked first.
>>
>> ---------------------------------------------------------------------
>> 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
>
>
-- 
Geir Magnusson Jr                                   203-247-1713(m)
geir@4quarters.com


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


Re: multiple resource.managers using VVS

Posted by "Charles N. Harvey III" <ch...@alloy.com>.
Does velocity automatically try the first one then the second?
That's the only part I wasn't sure of.  I thought that I had to
specify which one came from which place.  But if it tries 1 then
2 then I'm all set.

Thanks so much for all these tips.


Charlie


Bill Stilwell wrote:

>Geir Magnusson Jr said:
>  
>
>>On Feb 19, 2004, at 1:10 PM, Nathan Bubna wrote:
>>
>>    
>>
>>>Charles N. Harvey III said:
>>>      
>>>
>>>>Hello again.
>>>>If I define multiple resource.manager (say, webapp and url) and I am
>>>>using
>>>>velocity in a servlet context, then I can choose which resource
>>>>manager
>>>>that I use to retrieve which templates.  Can this be done if I am
>>>>using VVS?
>>>>Most of my templates are in the webapp, but ones that change 3 times
>>>>a day
>>>>make it annoying to re-deploy a webapp all the time.  (we don't have
>>>>the
>>>>best deployment setup here)  So I would like to be able to add the url
>>>>resource manager and get a few templates from another machine.
>>>>
>>>>Is this possible?  Thanks for the help.
>>>>        
>>>>
>
>  
>
>>Right - just deal w/ it when you configure velocity, like you would in
>>any other scenario
>>    
>>
>
>We're currently doing this and it's pretty easy, just configure it in
>velocity.properties:
>
>resource.loader = webapp,file
>file.resource.loader.description = Velocity File Resource Loader
>file.resource.loader.class =
>org.apache.velocity.runtime.resource.loader.FileResourceLoader
>file.resource.loader.path = /path/to/templates
>file.resource.loader.cache = true
>file.resource.loader.modificationCheckInterval = 120
>
>I'd recommend that you put whatever resource loader that handles the most
>templates go first in the resource.loader line, as it's checked first.
>
>---------------------------------------------------------------------
>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


Re: multiple resource.managers using VVS

Posted by Bill Stilwell <bi...@marginalia.org>.
Geir Magnusson Jr said:
>
> On Feb 19, 2004, at 1:10 PM, Nathan Bubna wrote:
>
>> Charles N. Harvey III said:
>>> Hello again.
>>> If I define multiple resource.manager (say, webapp and url) and I am
>>> using
>>> velocity in a servlet context, then I can choose which resource
>>> manager
>>> that I use to retrieve which templates.  Can this be done if I am
>>> using VVS?
>>> Most of my templates are in the webapp, but ones that change 3 times
>>> a day
>>> make it annoying to re-deploy a webapp all the time.  (we don't have
>>> the
>>> best deployment setup here)  So I would like to be able to add the url
>>> resource manager and get a few templates from another machine.
>>>
>>> Is this possible?  Thanks for the help.

> Right - just deal w/ it when you configure velocity, like you would in
> any other scenario

We're currently doing this and it's pretty easy, just configure it in
velocity.properties:

resource.loader = webapp,file
file.resource.loader.description = Velocity File Resource Loader
file.resource.loader.class =
org.apache.velocity.runtime.resource.loader.FileResourceLoader
file.resource.loader.path = /path/to/templates
file.resource.loader.cache = true
file.resource.loader.modificationCheckInterval = 120

I'd recommend that you put whatever resource loader that handles the most
templates go first in the resource.loader line, as it's checked first.

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


Re: multiple resource.managers using VVS

Posted by Geir Magnusson Jr <ge...@4quarters.com>.
On Feb 19, 2004, at 1:10 PM, Nathan Bubna wrote:

> Charles N. Harvey III said:
>> Hello again.
>> If I define multiple resource.manager (say, webapp and url) and I am 
>> using
>> velocity in a servlet context, then I can choose which resource 
>> manager
>> that I use to retrieve which templates.  Can this be done if I am 
>> using VVS?
>> Most of my templates are in the webapp, but ones that change 3 times 
>> a day
>> make it annoying to re-deploy a webapp all the time.  (we don't have 
>> the
>> best deployment setup here)  So I would like to be able to add the url
>> resource manager and get a few templates from another machine.
>>
>> Is this possible?  Thanks for the help.
>
> well, i've never used multiple resource managers myself, so if this is 
> a
> question about the limitations and possibilities in doing that, i 
> can't help
> you.  but assuming this is something that works with Velocity (in 
> singleton
> mode) in general, then i can't see any reason this couldn't be made to 
> work
> with the VVS.

Right - just deal w/ it when you configure velocity, like you would in 
any other scenario

>
> Nathan Bubna
> nathan@esha.com
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: velocity-user-help@jakarta.apache.org
>
>
-- 
Geir Magnusson Jr                                   203-247-1713(m)
geir@4quarters.com


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


Re: multiple resource.managers using VVS

Posted by Nathan Bubna <na...@esha.com>.
Charles N. Harvey III said:
> Hello again.
> If I define multiple resource.manager (say, webapp and url) and I am using
> velocity in a servlet context, then I can choose which resource manager
> that I use to retrieve which templates.  Can this be done if I am using VVS?
> Most of my templates are in the webapp, but ones that change 3 times a day
> make it annoying to re-deploy a webapp all the time.  (we don't have the
> best deployment setup here)  So I would like to be able to add the url
> resource manager and get a few templates from another machine.
>
> Is this possible?  Thanks for the help.

well, i've never used multiple resource managers myself, so if this is a
question about the limitations and possibilities in doing that, i can't help
you.  but assuming this is something that works with Velocity (in singleton
mode) in general, then i can't see any reason this couldn't be made to work
with the VVS.

Nathan Bubna
nathan@esha.com


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