velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Will Glass-Husain" <wgl...@forio.com>
Subject Re: Using ClassPathResourceLoader in an app
Date Tue, 07 Dec 2004 18:12:46 GMT
You can turn on caching with this property:

classpath.resource.loader.cache = true

WILL

----- Original Message ----- 
From: "Gaurav Gehlot" <ggehlot@siac.com>
To: "Velocity Users List" <velocity-user@jakarta.apache.org>
Sent: Tuesday, December 07, 2004 10:03 AM
Subject: Re: Using ClassPathResourceLoader in an app


> Do I need to specify any directive for the caching to take place or does
> the ClassPathResourceLoader take care of the caching automatically?
>
> gaurav
>
>
>
> |---------+---------------------------->
> |         |           "Will            |
> |         |           Glass-Husain"    |
> |         |           <wglass@forio.com|
> |         |           >                |
> |         |                            |
> |         |           12/07/2004 12:38 |
> |         |           PM               |
> |         |           Please respond to|
> |         |           "Velocity Users  |
> |         |           List"            |
> |         |                            |
> |---------+---------------------------->
> 
>  >------------------------------------------------------------------------------------------------------------------------------|
>  | 
> |
>  |       To:       "Velocity Users List" 
> <velocity-user@jakarta.apache.org> 
> |
>  |       cc:       (bcc: Gaurav Gehlot/SIAC) 
> |
>  |       Subject:  Re: Using ClassPathResourceLoader in an app 
> |
> 
>  >------------------------------------------------------------------------------------------------------------------------------|
>
>
>
>
> Hi Gaurov,
>
> Yes, that looks good.  Note that if you're running in a web app the
> Velocity
> jar file and the templates must both be in the WEB-INF folder (classes/lib
> directory) or in the application container classpath, but not split 
> between
>
> the two.
>
> Caching works with ClassPathLoader, but reloading does not.  That means if
> you change a template while the app is running it won't pick up the
> changes.
>
> Best,
> WILL
>
> ----- Original Message -----
> From: "Gaurav Gehlot" <ggehlot@siac.com>
> To: <velocity-user@jakarta.apache.org>
> Sent: Tuesday, December 07, 2004 8:52 AM
> Subject: Using ClassPathResourceLoader in an app
>
>
>> Hi,
>>      I am trying to use Velocity in an application with ClassPath
> resource
>> loader. Is the following usage correct to set this loader
> programatically,
>>
>>      Velocity.setProperty(Velocity.RUNTIME_LOG_LOGSYSTEM, new
>> VelocityLogger(LOGGER));
>>      Velocity.setProperty(Velocity.RESOURCE_LOADER, "classpath");
>>            Velocity.setProperty("classpath." +
>> VelocityEngine.RESOURCE_LOADER + ".class",
>> ClasspathResourceLoader.class.getName());
>>
>>      Also, is it possible to cache the templates using ClassPathLoader as
>> can be done with FileResourceLoader using the
>> Velocity.FILE_RESOURCE_LOADER_CACHE property?
>> Thanx
>> gaurav
>>
>>
>> -----------------------------------------
>> This message and its attachments may contain  privileged and confidential
>> information.  If you are not the intended recipient(s), you are
> prohibited
>> from printing, forwarding, saving or copying this email.  If you have
>> received this e-mail in error, please immediately notify the sender and
>> delete this e-mail and its attachments from your computer.
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>
>
>
>
> -----------------------------------------
> This message and its attachments may contain  privileged and confidential
> information.  If you are not the intended recipient(s), you are prohibited
> from printing, forwarding, saving or copying this email.  If you have
> received this e-mail in error, please immediately notify the sender and
> delete this e-mail and its attachments from your computer.
>
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message