velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Will Glass-Husain" <>
Subject Re: Using ClassPathResourceLoader in an app
Date Tue, 07 Dec 2004 17:38:56 GMT
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.


----- Original Message ----- 
From: "Gaurav Gehlot" <>
To: <>
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
> 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:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message