JSP use isErrorPAge attribute for runtime exception handling. One can handle exceptions within a JSP page or can write a JSP page to handle exceptions. To handle runtime exceptions in the same page, use the following:

Java Code:
<%@ page isErrorPage="true" %>
To handle exceptions in a separate a JSP page, use the following:

Java Code:
<%@ page isErrorPage="false" errorPage="errorHandler.jsp" %>
All the uncaught exceptions will be forwarded to errorHanler.jsp.