Revert "Code cleanups for direct RequestDispatcher access"

This reverts commit 1ff665f76a.
This commit is contained in:
Greg Wilkins 2013-06-24 13:11:04 +10:00
parent 1ff665f76a
commit b2b2ce25fc
2 changed files with 13 additions and 12 deletions

View File

@ -26,7 +26,6 @@ import java.util.Collections;
import java.util.Enumeration;
import java.util.Locale;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
@ -342,10 +341,10 @@ public class Response implements HttpServletResponse
error_handler = _connection.getConnector().getServer().getBean(ErrorHandler.class);
if (error_handler!=null)
{
request.setAttribute(RequestDispatcher.ERROR_STATUS_CODE,new Integer(code));
request.setAttribute(RequestDispatcher.ERROR_MESSAGE, message);
request.setAttribute(RequestDispatcher.ERROR_REQUEST_URI, request.getRequestURI());
request.setAttribute(RequestDispatcher.ERROR_SERVLET_NAME,request.getServletName());
request.setAttribute(Dispatcher.ERROR_STATUS_CODE,new Integer(code));
request.setAttribute(Dispatcher.ERROR_MESSAGE, message);
request.setAttribute(Dispatcher.ERROR_REQUEST_URI, request.getRequestURI());
request.setAttribute(Dispatcher.ERROR_SERVLET_NAME,request.getServletName());
error_handler.handle(null,_connection.getRequest(),_connection.getRequest(),this );
}
else

View File

@ -24,19 +24,20 @@ import java.util.Arrays;
import java.util.Collections;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
import java.util.HashSet;
import java.util.ListIterator;
import java.util.Set;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.ConcurrentMap;
import javax.servlet.AsyncContext;
import javax.servlet.DispatcherType;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.RequestDispatcher;
import javax.servlet.Servlet;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
@ -57,6 +58,7 @@ import org.eclipse.jetty.security.IdentityService;
import org.eclipse.jetty.security.SecurityHandler;
import org.eclipse.jetty.server.AbstractHttpConnection;
import org.eclipse.jetty.server.Dispatcher;
import org.eclipse.jetty.server.AbstractHttpConnection;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.ServletRequestHttpWrapper;
@ -391,8 +393,8 @@ public class ServletHandler extends ScopedHandler
if (DispatcherType.INCLUDE.equals(type))
{
baseRequest.setAttribute(RequestDispatcher.INCLUDE_SERVLET_PATH,servlet_path);
baseRequest.setAttribute(RequestDispatcher.INCLUDE_PATH_INFO, path_info);
baseRequest.setAttribute(Dispatcher.INCLUDE_SERVLET_PATH,servlet_path);
baseRequest.setAttribute(Dispatcher.INCLUDE_PATH_INFO, path_info);
}
else
{
@ -560,8 +562,8 @@ public class ServletHandler extends ScopedHandler
if (!response.isCommitted())
{
request.setAttribute(RequestDispatcher.ERROR_EXCEPTION_TYPE,th.getClass());
request.setAttribute(RequestDispatcher.ERROR_EXCEPTION,th);
request.setAttribute(Dispatcher.ERROR_EXCEPTION_TYPE,th.getClass());
request.setAttribute(Dispatcher.ERROR_EXCEPTION,th);
if (th instanceof UnavailableException)
{
UnavailableException ue = (UnavailableException)th;