Hi Carfield,

> Can anybody tell me how to setup VelocityEngine to use
> ClasspathResourceLoader?
    
http://jakarta.apache.org/velocity/api/org/apache/velocity/runtime/resource/loader/ClasspathResourceLoader.html

> 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?
What does the stack trace have to say?
What was inside "templatePath"?
What was inside "velocityContext"?
Where is the classpath?
Where is the template?  What does it look like?

Asking yourself these questions should lead you to the solution. 
(Hopefully ;))

Best regards,
-- Shinobu Kawai

--
Shinobu Kawai <[EMAIL PROTECTED]>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to