Hi,

> The root of the problem is that
> java.util.jar.JarFile#getJarEntry(String name) will not return
> anything if a "/" is leading the name.  This causes
> org.apache.catalina.loader.WebappClassLoader#findResourceInternal(String
> name, String path) to return null.  This causes
> org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader#getResourceStream(String
> name) to return null.  This causes your ResourceNotFoundException.
> 
> If we fix ClasspathResourceLoader so it trims the leading "/"s like in
> WebappLoader, it will work.  I'm not sure if this is the right fix,
> though.  It might just be a Tomcat issue.  I'll attach the patch
> anyways.
You know what?  I think it's not the ClasspathResourceLoader's
responsibility.  It's just doing its stuff.  A better place to trim the
leading "/"s is where the template path is being created, namely
o.a.v.t.view.servlet.VelocityViewServlet#handleRequest(...).

And here's the patch to do so.

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