Merge branch 'master' of ssh://git.eclipse.org/gitroot/jetty/org.eclipse.jetty.project

This commit is contained in:
Jan Bartel 2011-12-05 08:31:49 +11:00
commit 15ab626410
2 changed files with 41 additions and 25 deletions

View File

@ -370,9 +370,11 @@ public class ResourceHandler extends HandlerWrapper
if (resource==null || !resource.exists())
{
if (target.endsWith("/jetty-dir.css"))
{
response.setContentType("text/css");
{
resource = getStylesheet();
if (resource==null)
return;
response.setContentType("text/css");
}
else
{

View File

@ -394,22 +394,19 @@ public class ServletHandler extends ScopedHandler
try
{
// Do the filter/handling thang
if (servlet_holder!=null)
{
old_scope=baseRequest.getUserIdentityScope();
baseRequest.setUserIdentityScope(servlet_holder);
old_scope=baseRequest.getUserIdentityScope();
baseRequest.setUserIdentityScope(servlet_holder);
// start manual inline of nextScope(target,baseRequest,request,response);
if (never())
nextScope(target,baseRequest,request,response);
else if (_nextScope!=null)
_nextScope.doScope(target,baseRequest,request, response);
else if (_outerScope!=null)
_outerScope.doHandle(target,baseRequest,request, response);
else
doHandle(target,baseRequest,request, response);
// end manual inline (pathentic attempt to reduce stack depth)
}
// start manual inline of nextScope(target,baseRequest,request,response);
if (never())
nextScope(target,baseRequest,request,response);
else if (_nextScope!=null)
_nextScope.doScope(target,baseRequest,request, response);
else if (_outerScope!=null)
_outerScope.doHandle(target,baseRequest,request, response);
else
doHandle(target,baseRequest,request, response);
// end manual inline (pathentic attempt to reduce stack depth)
}
finally
{
@ -460,7 +457,10 @@ public class ServletHandler extends ScopedHandler
{
if (servlet_holder==null)
{
notFound(request, response);
if (getHandler()==null)
notFound(request, response);
else
nextHandle(target,baseRequest,request,response);
}
else
{
@ -1230,6 +1230,7 @@ public class ServletHandler extends ScopedHandler
HttpServletResponse response)
throws IOException
{
new Throwable().printStackTrace();
if(LOG.isDebugEnabled())
LOG.debug("Not Found "+request.getRequestURI());
response.sendError(HttpServletResponse.SC_NOT_FOUND);
@ -1318,7 +1319,9 @@ public class ServletHandler extends ScopedHandler
/* ------------------------------------------------------------ */
public void doFilter(ServletRequest request, ServletResponse response)
throws IOException, ServletException
{
{
final Request baseRequest=(request instanceof Request)?((Request)request):AbstractHttpConnection.getCurrentConnection().getRequest();
// pass to next filter
if (_filterHolder!=null)
{
@ -1329,7 +1332,6 @@ public class ServletHandler extends ScopedHandler
filter.doFilter(request, response, _next);
else
{
final Request baseRequest=(request instanceof Request)?((Request)request):AbstractHttpConnection.getCurrentConnection().getRequest();
final boolean suspendable=baseRequest.isAsyncSupported();
if (suspendable)
{
@ -1350,15 +1352,20 @@ public class ServletHandler extends ScopedHandler
}
// Call servlet
HttpServletRequest srequest = (HttpServletRequest)request;
if (_servletHolder != null)
{
if (LOG.isDebugEnabled())
LOG.debug("call servlet " + _servletHolder);
final Request baseRequest=(request instanceof Request)?((Request)request):AbstractHttpConnection.getCurrentConnection().getRequest();
_servletHolder.handle(baseRequest,request, response);
}
else // Not found
notFound((HttpServletRequest)request, (HttpServletResponse)response);
else if (getHandler()==null)
notFound(srequest, (HttpServletResponse)response);
else
nextHandle(URIUtil.addPaths(srequest.getServletPath(),srequest.getPathInfo()),
baseRequest,srequest,(HttpServletResponse)response);
}
public String toString()
@ -1424,14 +1431,21 @@ public class ServletHandler extends ScopedHandler
}
// Call servlet
HttpServletRequest srequest = (HttpServletRequest)request;
if (_servletHolder != null)
{
if (LOG.isDebugEnabled())
LOG.debug("call servlet " + _servletHolder);
_servletHolder.handle(_baseRequest,request, response);
}
else // Not found
notFound((HttpServletRequest)request, (HttpServletResponse)response);
else if (getHandler()==null)
notFound(srequest, (HttpServletResponse)response);
else
{
Request baseRequest=(request instanceof Request)?((Request)request):AbstractHttpConnection.getCurrentConnection().getRequest();
nextHandle(URIUtil.addPaths(srequest.getServletPath(),srequest.getPathInfo()),
baseRequest,srequest,(HttpServletResponse)response);
}
}
/* ------------------------------------------------------------ */