velocity-user mailing list archives

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

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

Regards,
uday




-----Original Message-----
From: Shinobu Kawai [mailto:shinobu.kawai@gmail.com]
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
FAQ.
     http://wiki.apache.org/jakarta-velocity/VelocityFAQ
## 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 <shinobu.kawai@gmail.com>

---------------------------------------------------------------------
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