Reputation: 3328
In tomcat, an invalid link can throw a HTTP Status 404 – Not Found
as follows.
How to configure tomcat
to redirect it to an error information page, such as The request is invalid!
if such a case happens?
Upvotes: 2
Views: 1946
Reputation: 78
Need to add the following to file ROOT/WEB-INF/web.xml
<error-page>
<error-code>404</error-code>
<location>/yourLocationToredirect</location>
</error-page>
Also write a message in any html or jsp and add this page as redirect location
The following link discussed the same question https://serverfault.com/questions/254102/custom-error-pages-on-apache-tomcat
Upvotes: 2