velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sebastiano Vigna <>
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 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...



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

View raw message