velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carfield Yim <carfi...@carfield.com.hk>
Subject How to config velocity to use ClasspathResourceLoader?
Date Tue, 02 Nov 2004 05:22:17 GMT
Can anybody tell me how to setup VelocityEngine to use
ClasspathResourceLoader? I've the following code but fail to work:

VelocityEngine ve = new VelocityEngine();
ve.setProperty("resource.loader", "class");
ve.setProperty("class.resource.loader.class","org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
Template t = ve.getTemplate(templatePath, "UTF-8");
t.merge(velocityContext, writer);

At "Template t = ve.getTemplate(templatePath, "UTF-8");", I get
NullPointerException, can anyone give me some hint about that?


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