velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Uday Kumar" <>
Subject RE: Loading templates from classpath
Date Sat, 02 Apr 2005 07:19:29 GMT

Can u pls help me regarding velocity macros .
how to create a macro library and also i would like to use a macro  to
embedd a tree structure in web page


-----Original Message-----
From: Shinobu Kawai []
Sent: Saturday, April 02, 2005 3:37 AM
To: Velocity Users List
Subject: Re: Loading templates from classpath

Hi seba,

> You read my mind. 8^) Here's the catch: put this in the servlet.
> protected Properties loadConfiguration( final ServletConfig config )
throws FileNotFoundException, IOException {
>        Properties p = super.loadConfiguration( config );
>        p.setProperty( "resource.loader", "class" );
>        p.setProperty( "class.resource.loader.class",
ClasspathResourceLoader.class.getName() );
>        return p;
> }

Thanks for sharing your solution with us!  Maybe someday it'll get into the
## Anyone can update the wiki, BTW.  B)

> What was completely confusing me is that Velocity defines a number of
> final static constant strings for properties, but apparently not for
> *all* properties. "class.resource.loader.class" is not in, or I couldn't
> find it. Anyway...

FYI, there's one for "resource.loader".  :)

Best regards,
-- Shinobu

Shinobu Kawai <>

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

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

View raw message