tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chris monster <>
Subject re: Re: ServletContext.getResource() never null?
Date Tue, 14 Aug 2001 03:42:02 GMT
thanx guys!  sorry, in the future i will try to exhaust later versions
before i post... ;)

> It also looks a totally different place -- inside /WEB-INF/classes or
> inside JAR files under /WEB-INF/lib.

true!  however, my purpose was to create a singleton wrapper for access
to resources by non-servlet classes which might deployed inside OR
outside a container.  by *not* explicitly using ClassLoader, i can make
the wider scope (of the entire webapp's directory structure) available
to the non-servlet classes when used in that environment.  that said,
the more similarly these methods behave, the less work i have to do. ;)

in response to Amy:

> What did you get instead of null when there's no resource at that path?

a file: url that reflects the path i asked for, even though the resource
doesn't exist.  were i to getResourceAsStream(), it would be empty.  

as Craig indicated, i think the solution is to move our development up
to a later version of Tomcat.

View raw message