You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Davide Mora <d_...@yahoo.com> on 2001/08/28 17:14:43 UTC

loading a .vm with getResource()

Hi,

is possible load a .vm via getResource()? Other ways
for load a .vm from the .jar where run my application?

Thank you,
Davide

__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

Re: loading a .vm with getResource()

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
On 8/28/01 11:14 AM, "Davide Mora" <d_...@yahoo.com> wrote:

> 
> Hi,
> 
> is possible load a .vm via getResource()? Other ways
> for load a .vm from the .jar where run my application?

Yes - take a look at either the ClasspathResourceLoader, which will take it
form the classpath - I use this all the time - I bundle my templates into
jars and put them in WEB-INF/lib.  Keeps my deployment really simple.  You
can do this because the servlet spec requires all jars in WEB-INF/lib to be
in the classpath automatically.

If this is for an application, you can either put them into the classpath,
or use the JarResourceLoader, where you specify the jars to load from at
config time.

There are a few examples on configuration in the dev guide - give them a
look...

Geir