tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chris monster <>
Subject ServletContext.getResource() never null?
Date Mon, 13 Aug 2001 21:51:15 GMT
in the api-docs for ServletContext.getResource( String path ), it is
further specified that:

"This method returns null if no resource is mapped to the pathname."


"The path must begin with a "/"..."

are these stipulations in the servlet api-docs valid?

in testing several containers including Tomcat 3.1.1, i was unable to
get a null ( where a test for null would have been, um, desirable ), nor
did it appear that the presence or absence of a leading "/" made any

by way of contrast, consider the tantalizingly similar:

java.lang.ClassLoader.getResource( String path )

which specifically does *not* expect a leading slash, and very
definitely returns null when the resource does not exist.


View raw message