diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ErrorPageErrorHandler.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ErrorPageErrorHandler.java index 47578e7d920e..e91e67ef31e2 100644 --- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ErrorPageErrorHandler.java +++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ErrorPageErrorHandler.java @@ -75,7 +75,13 @@ public String getErrorPage(HttpServletRequest request) if (errorPage != null) matchedThrowable = exClass; - th = (th instanceof ServletException) ? ((ServletException)th).getRootCause() : null; + if (th instanceof ServletException){ + th = ((ServletException)th).getRootCause(); + if (th != null) { + request.setAttribute(Dispatcher.ERROR_EXCEPTION_TYPE, th.getClass()); + } + } + } Integer errorStatusCode = null;