Pascal Houde wrote:
> Hi,
> There's something I don't understand about getResource(String path). What
> the "path" argument is supposed to be? I gave something like
> "/includes/sometext.txt" but getResource always return a null object. Is it
> an implementation problem from my servlet engine? I am using JRUN2.3.3 for
> NT / JDK1.2 / JSDK2.1.
>
> Thanks in advance
> Pascal
>
According to the "clarifications" to the 2.1 spec that were published in the
JSP 1.0 spec (appendix B), the path for getResource() is interpreted as being
relative to the "document root" for the servlet context you are running in.
If you're running the JSDK 2.1 servlet engine with an unmodified
configuration, that means a call like this:
URL url = getServletContext().getResource("/abc/def.ghi");
will look for a file at the following path, where $JSDK_HOME is your install
directory:
$JSDK_HOME/webpages/abc/def.ghi
because "webpages" is the document root of the default context (see the
default.cfg configuration file). You will have to check your JRun
documentation to see how the document root is configured for it.
Craig McClanahan
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html