else
log("DefaultServlet.serveResource: Serving resource '" +
path + "' headers only");
}
CacheEntry cacheEntry = null;
ProxyDirContext proxyDirContext = resources;
if (alternateDocBases == null
|| alternateDocBases.size() == 0) {
cacheEntry = proxyDirContext.lookupCache(path);
} else {
AlternateDocBase match = AlternateDocBase.findMatch(
path, alternateDocBases);
if (match != null) {
cacheEntry = ((ProxyDirContext) match.getResources()).lookupCache(path);
} else {
// None of the url patterns for alternate docbases matched
cacheEntry = proxyDirContext.lookupCache(path);
}
}
if (!cacheEntry.exists) {
// Try looking up resource in
// WEB-INF/lib/[*.jar]/META-INF/resources
ClassLoader cl = Thread.currentThread().getContextClassLoader();
String metaInfResPath = Globals.META_INF_RESOURCES + path;
if (cl instanceof WebappClassLoader) {
WebappClassLoader wcl = (WebappClassLoader)cl;
final URL resourceUrl = wcl.getResourceFromJars(metaInfResPath);
if (resourceUrl != null) {
// XXX Remove dependency on WebappClassLoader
ConcurrentHashMap<String, ResourceEntry> resourceEntries =
wcl.getResourceEntries();
ResourceEntry resourceEntry = resourceEntries.get(metaInfResPath);
if (resourceEntry != null) {
// create a CacheEntry to continue the processing
cacheEntry = new CacheEntry();
try {
URI resourceUri = resourceUrl.toURI();
if ("file".equals(resourceUri.getScheme()) &&
(new File(resourceUri)).isDirectory()) {
if (!path.endsWith("/")) {