velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shinobu Kawai <shinobu.ka...@gmail.com>
Subject Re: Loading templates from classpath
Date Fri, 01 Apr 2005 22:06:36 GMT
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


Mime
View raw message