What is errorPage attribute in JSP?

The errorPage attribute tells the JSP engine which page to display if there is an error while the current page runs. The value of the errorPage attribute is a relative URL.

The following directive displays MyErrorPage.jsp when all uncaught exceptions are thrown −

<%@ page errorPage = "MyErrorPage.jsp" %>

The isErrorPage attribute indicates that the current JSP can be used as the error page for another JSP.

The value of isErrorPage is either true or false. The default value of the isErrorPage attribute is false.

For example, handleError.jsp sets the isErrorPage option to true because it is supposed to handle errors −

<%@ page isErrorPage = "true" %>

Updated on: 30-Jul-2019


Kickstart Your Career

Get certified by completing the course

Get Started