I am using tomcat and I would like, whenever I go to a direction that is not handled by a servlet, do other stuff insead of showing the default error:
type Status report
message /test
description The requested resource is not available.
Where can I handle this¿?
Thank you in advance
Since Tomcat 9 there is different error handling configuration.
You have to:
<Valve className="org.apache.catalina.valves.ErrorReportValve" errorCode.404="webapps/ROOT/error_page.html" errorCode.0="webapps/ROOT/error_page.html" showReport="false" showServerInfo="false" />
Please refer: https://stackoverflow.com/a/55702749/2532710 or Tomcat documentation: https://tomcat.apache.org/tomcat-9.0-doc/config/valve.html#Error_Report_Valve
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With