https://bz.apache.org/bugzilla/show_bug.cgi?id=63622
Bug ID: 63622 Summary: Host Manager's 404.jsp throws exception Product: Tomcat 9 Version: 9.0.22 Hardware: Sun OS: Solaris Status: NEW Severity: trivial Priority: P2 Component: Manager Assignee: dev@tomcat.apache.org Reporter: andreas.ofenbo...@atos.net Target Milestone: ----- The host manager's 404.jsp throws the following exception. DD-MMM-YYYY HH:mm:ss SEVERE [http-nio-8080-exec-5] org.apache.catalina.core.StandardHostValve.custom Exception Processing ErrorPage[errorCode=404, location=/WEB-INF/jsp/404.jsp] org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: [36] in the jsp file: [/WEB-INF/jsp/404.jsp] The method filter(String) is undefined for the type RequestUtil 33: <h1>404 Not found</h1> 34: <p> 35: The page you tried to access 36: (<%=RequestUtil.filter((String) request.getAttribute( 37: "javax.servlet.error.request_uri"))%>) 38: does not exist. 39: </p> Stacktrace: at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:103) at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:213) at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:522) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:392) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:362) at org.apache.jasper.compiler.Compiler.compile(Compiler.java:346) at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:603) at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:399) at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:385) at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:329) at javax.servlet.http.HttpServlet.service(HttpServlet.java:741) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:712) at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:461) at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:384) at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:312) at org.apache.catalina.core.StandardHostValve.custom(StandardHostValve.java:394) at org.apache.catalina.core.StandardHostValve.status(StandardHostValve.java:253) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:175) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:853) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1587) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.base/java.lang.Thread.run(Thread.java:834) --- The manager app does not have this issue, so I did a diff (output shows the relevant first few lines only): diff -u apache-tomcat-9.0.22/webapps/host-manager/WEB-INF/jsp/404.jsp apache-tomcat-9.0.22/webapps/manager/WEB-INF/jsp/404.jsp --- apache-tomcat-9.0.22/webapps/host-manager/WEB-INF/jsp/404.jsp Thu Jul 4 16:23:49 2019 +++ apache-tomcat-9.0.22/webapps/manager/WEB-INF/jsp/404.jsp Thu Jul 4 16:23:49 2019 @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. --%> -<%@ page import="org.apache.catalina.util.RequestUtil" session="false" +<%@ page import="org.apache.tomcat.util.security.Escape" session="false" trimDirectiveWhitespaces="true" %> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> @@ -33,18 +33,20 @@ <h1>404 Not found</h1> <p> The page you tried to access - (<%=RequestUtil.filter((String) request.getAttribute( + (<%=Escape.htmlElementContent((String) request.getAttribute( "javax.servlet.error.request_uri"))%>) does not exist. </p> --- and replaced the RequestUtil with the org.apache.tomcat.util.security.Escape The error is gone. br Andreas -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org