On 20/12/2018 06:44, Melvin wrote: > Hello All, > > Just came across a problem today. Hope someone will clarify it. > > Tomcat 9.0.13. > I wanted to customize ErrorReportValve by setting showReport="false" > showServerInfo="false". > > Below is the META-INF/context.xml - > <Context> > <Valve className="org.apache.catalina.valves.ErrorReportValve" > showReport="false" showServerInfo="false" /> > </Context> > > It works fine for any internal server error produced or exceptions > thrown. But for the case when the browser sends unencoded characters the > URL becomes invalid and Exception is thrown and stacktrace is shown in > the browser. > When I give this valve in server.xml. It works fine. No issues. No > stacktrace is shown on the browser when sending unencoded characters. > When I give it in my context it fails only for this case. > > Can anyone please help me on this.
You are configuring the Valve on different elements. In server.xml you are configuring it on the Host. In context.xml you are configuring it for a single web application. If the URL is invalid then the request will never be mapped to a web application so the ErrorReportVlave on the default Host will be used. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org