diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ErrorHandler.java b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ErrorHandler.java index 98fdb08b596..7d11d60bdd4 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ErrorHandler.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/handler/ErrorHandler.java @@ -416,7 +416,10 @@ public class ErrorHandler extends AbstractHandler htmlRow(writer, "URI", uri); htmlRow(writer, "STATUS", status); htmlRow(writer, "MESSAGE", message); - htmlRow(writer, "SERVLET", request.getAttribute(Dispatcher.ERROR_SERVLET_NAME)); + if (isShowServlet()) + { + htmlRow(writer, "SERVLET", request.getAttribute(Dispatcher.ERROR_SERVLET_NAME)); + } Throwable cause = (Throwable)request.getAttribute(Dispatcher.ERROR_EXCEPTION); while (cause != null) { @@ -457,7 +460,7 @@ public class ErrorHandler extends AbstractHandler while (cause != null) { writer.printf("CAUSED BY %s%n", cause); - if (_showStacks && !_disableStacks) + if (isShowStacks() && !_disableStacks) { cause.printStackTrace(writer); }