thread.setContextClassLoader(getClassLoader());
try {
FilterChain chain = null;
if (_configException != null) {
chain = new ExceptionFilterChain(_configException);
invocation.setFilterChain(chain);
invocation.setDependency(AlwaysModified.create());
return invocation;
}
else if (! _lifecycle.waitForActive(_activeWaitTime)) {
if (log.isLoggable(Level.FINE))
log.fine(this + " returned 503 busy for '" + invocation.getRawURI() + "'");
int code = HttpServletResponse.SC_SERVICE_UNAVAILABLE;
chain = new ErrorFilterChain(code);
invocation.setFilterChain(chain);
invocation.setDependency(AlwaysModified.create());
return invocation;
}
else {
FilterChainEntry entry = null;
// jsp/1910 - can't cache jsp_precompile
String query = invocation.getQueryString();
boolean isCache = true;
if (query != null && query.indexOf("jsp_precompile") >= 0)
isCache = false;
else if (_requestRewriteDispatch != null)
isCache = false;
if (isCache)
entry = _filterChainCache.get(invocation.getContextURI());
if (entry != null && ! entry.isModified()) {
chain = entry.getFilterChain();
invocation.setServletName(entry.getServletName());
if (! entry.isAsyncSupported())
invocation.clearAsyncSupported();
invocation.setMultipartConfig(entry.getMultipartConfig());
} else {
chain = _servletMapper.mapServlet(invocation);
// server/13s[o-r]
_filterMapper.buildDispatchChain(invocation, chain);
chain = invocation.getFilterChain();
chain = applyWelcomeFile(DispatcherType.REQUEST, invocation, chain);
if (_requestRewriteDispatch != null) {
FilterChain newChain
= _requestRewriteDispatch.map(DispatcherType.REQUEST,
invocation.getContextURI(),
invocation.getQueryString(),
chain);
chain = newChain;
}
/*
// server/13s[o-r]
// _filterMapper.buildDispatchChain(invocation, chain);
chain = invocation.getFilterChain();
*/
entry = new FilterChainEntry(chain, invocation);
chain = entry.getFilterChain();
if (isCache)
_filterChainCache.put(invocation.getContextURI(), entry);
}
chain = buildSecurity(chain, invocation);
chain = createWebAppFilterChain(chain, invocation, true);
invocation.setFilterChain(chain);
invocation.setPathInfo(entry.getPathInfo());
invocation.setServletPath(entry.getServletPath());
}
if (_oldWebApp != null
&& Alarm.getCurrentTime() < _oldWebAppExpireTime) {
Invocation oldInvocation = new Invocation();
oldInvocation.copyFrom(invocation);
oldInvocation.setWebApp(_oldWebApp);
_oldWebApp.buildInvocation(oldInvocation);
invocation = new VersionInvocation(invocation, this,
oldInvocation,
oldInvocation.getWebApp(),
_oldWebAppExpireTime);
}
return invocation;
} catch (Throwable e) {
log.log(Level.WARNING, e.toString(), e);
FilterChain chain = new ExceptionFilterChain(e);
chain = new WebAppFilterChain(chain, this);
invocation.setDependency(AlwaysModified.create());
invocation.setFilterChain(chain);
return invocation;