velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastiano Vigna <vi...@dsi.unimi.it>
Subject Re: Loading templates from classpath
Date Sun, 03 Apr 2005 21:50:21 GMT
On Fri, 2005-04-01 at 13:43 -0800, Shinobu Kawai wrote:

> ## Let me guess; you don't want to make a velocity.properties file either.  :p

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

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

-- 
Ciao,

                                        seba


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