Exception Handling is a process of handling exceptional condition that might occur in your application. Exception Handling in JSP is much easier than Java Technology exception handling. Although JSP Technology also uses the same exception class object.

Example of isErrorPage and errorPage attribute

Exception Handling in JSP

We can handle the exceptions in jsp by specifying error Page in the page directive, <%@ page errorPage = "errorPage.jsp">. If any exception will be thrown then the control to handle the exception will be passed to that error page where we can display a information to the user about what’s the reason behind throwing the exception.

Example of JSP isErrorPage and errorPage attributes

ErrorPage.jsp

download.

Tags: