file = context.resources.lookup(pathStr);
} catch(NamingException nex) {
// Swallow not found, since this is normal
}
} else {
AlternateDocBase match =
AlternateDocBase.findMatch(pathStr,
context.alternateDocBases);
if (match != null) {
try {
file = match.getResources().lookup(pathStr);
} catch(NamingException nex) {
// Swallow not found, since this is normal
}
} else {
// None of the url patterns for alternate
// docbases matched
try {
file = context.resources.lookup(pathStr);
} catch(NamingException nex) {
// Swallow not found, since this is normal
}
}
}
if (file != null && !(file instanceof DirContext) ) {
internalMapExtensionWrapper(extensionWrappers,
path, mappingData);
if (mappingData.wrapper == null
&& context.defaultWrapper != null) {
mappingData.wrapper =
context.defaultWrapper.object;
mappingData.requestPath.setChars
(path.getBuffer(), path.getStart(),
path.getLength());
mappingData.wrapperPath.setChars
(path.getBuffer(), path.getStart(),
path.getLength());
mappingData.requestPath.setString(pathStr);
mappingData.wrapperPath.setString(pathStr);
}
}
}
}
path.setOffset(servletPath);
path.setEnd(pathEnd);
}
}
// Rule 7 -- Default servlet
if (mappingData.wrapper == null && !checkJspWelcomeFiles) {
if (context.defaultWrapper != null) {
mappingData.wrapper = context.defaultWrapper.object;
mappingData.requestPath.setChars
(path.getBuffer(), path.getStart(), path.getLength());
mappingData.wrapperPath.setChars
(path.getBuffer(), path.getStart(), path.getLength());
}
// Redirection to a folder
char[] buf = path.getBuffer();
if (handleFolderRedirects && context.resources != null
&& buf[pathEnd -1 ] != '/') {
Object file = null;
String pathStr = path.toString();
if (context.alternateDocBases == null
|| context.alternateDocBases.isEmpty()) {
try {
file = context.resources.lookup(pathStr);
} catch(NamingException nex) {
// Swallow, since someone else handles the 404
}
} else {
AlternateDocBase match =
AlternateDocBase.findMatch(pathStr,
context.alternateDocBases);
if (match != null) {
try {
file = match.getResources().lookup(pathStr);
} catch(NamingException nex) {
// Swallow, since someone else handles the 404
}
} else {
// None of the url patterns for alternate