i have multiple web applications deployed on one tomcat web server. for all deployed web application, i want to display same 404.jsp page if 404 error occurred in any web application.
One way is to put an entry of 404 in each web application's web.xml and give proper location to the 404.jsp.
Is there any way so that all web application will display ROOT's 404 page on 404 error??
Thanks, Pavan
You can add this to the $CATALINA_HOME/conf/web.xml
<error-page>
<error-code>404</error-code>
<location>/error/404.html</location>
</error-page>
And add a webapp that has the page and will answer to the URL under <location>
Open web.xml under conf/
goto the bottom of the page.
add these lines for each http error code.
<error-page>
<error-code>404</error-code>
<location>/error.jsp</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/error.jsp</location>
</error-page>
Refer to the screenshot.
<html>
<body>
<h1>
<center>The Page You looking for is not available, please connect with administrator.</center>
</h1>
</body>
</html>
refer to the screenshot
refer to the attached screenshot.
5 results.
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