Christopher Piggott wrote:
> As an experiment, I placed a file in the webapp dir of a servlet (not in
> WEB-INF but in the directory above it) and attempted to read it using
> getResource().  What I found was that I could not locate the resource unless
> I used getServletContext().getResource().
> 

Your basic assumption that getServletContext().getResource() works by
using classloader means is simply wrong.

If you look at the JavaDoc of ServletContext it says that getResource()
works file based (relative to the context root) and does not use the
classloader.

http://tomcat.apache.org/tomcat-5.0-doc/servletapi/javax/servlet/ServletContext.html#getResource(java.lang.String)


Cheers,
Michael


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

Reply via email to