4
Error Page Handling In JSP
The error-page element declares a mapping between an error and a resource in the Web application that is called when that error occurs. Ther errors can be caused by HTTP errors (such as 404 Not Found) and Web application exceptions (like a ServletException). The errors can be mapped to any vali resource in the Web application, so it may be handled by a static HTML page, a JSP page, or a sevlet.
In web deployment descriptor put following
In web deployment descriptor put following
<web-app>
<error-page>
<error-code>404</error-code>
<location>/file-not-found.html<location>
</error-page>
<error-page>
<error-code>javax.servlet.ServletException</error-code>
<location>/oopsy.jsp<location>
</error-page>
.. while using action
<error-page>
<error-code>404</error-code>
<location>/showError.do<location>
</error-page>
</web-app>