diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/Response.java b/jetty-server/src/main/java/org/eclipse/jetty/server/Response.java index 272955324c0..2ab4e6c9f09 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/Response.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/Response.java @@ -26,6 +26,7 @@ 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; @@ -341,10 +342,10 @@ public class Response implements HttpServletResponse error_handler = _connection.getConnector().getServer().getBean(ErrorHandler.class); if (error_handler!=null) { - 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()); + 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()); error_handler.handle(null,_connection.getRequest(),_connection.getRequest(),this ); } else diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHandler.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHandler.java index 14e5fe054ca..9aff148ce98 100644 --- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHandler.java +++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletHandler.java @@ -38,6 +38,7 @@ 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; @@ -562,8 +563,8 @@ public class ServletHandler extends ScopedHandler if (!response.isCommitted()) { - request.setAttribute(Dispatcher.ERROR_EXCEPTION_TYPE,th.getClass()); - request.setAttribute(Dispatcher.ERROR_EXCEPTION,th); + request.setAttribute(RequestDispatcher.ERROR_EXCEPTION_TYPE,th.getClass()); + request.setAttribute(RequestDispatcher.ERROR_EXCEPTION,th); if (th instanceof UnavailableException) { UnavailableException ue = (UnavailableException)th; @@ -588,8 +589,8 @@ public class ServletHandler extends ScopedHandler // TODO httpResponse.getHttpConnection().forceClose(); if (!response.isCommitted()) { - request.setAttribute(Dispatcher.ERROR_EXCEPTION_TYPE,e.getClass()); - request.setAttribute(Dispatcher.ERROR_EXCEPTION,e); + request.setAttribute(RequestDispatcher.ERROR_EXCEPTION_TYPE,e.getClass()); + request.setAttribute(RequestDispatcher.ERROR_EXCEPTION,e); response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } else