How to create a server level custom error page in tomcat?

I have several web applications deployed on the same tomcat web server. for all deployed web applications, I want to display the same 404.jsp page if a 404 error occurred in any web application.

One way is to put a 404 entry in each web.xml web application and give the correct 404.jsp location.

Is there any way that all web applications display the ROOT 404 page on error 404?

Thanks Pavan

+8
tomcat
source share
1 answer

You can add this to $ CATALINA_HOME / conf / web.xml

<error-page> <error-code>404</error-code> <location>/error/404.html</location> </error-page> 

See http://wiki.apache.org/tomcat/FAQ/Miscellaneous#Q6

And add a webapp that has a page, and respond to the URL in <location>

+16
source share

All Articles