Mega Code Archive

 
Categories / Java Tutorial / JSP
 

Display Error Message In Error Handling Page

index.jsp <%@ page errorPage="errorPage.jsp" %> <HTML>     <HEAD>         <TITLE>Using the exception Object</TITLE>     </HEAD>     <BODY>         <H1>Using the exception Object</H1>         <%             int value = 1;             value = value / 0;         %>     </BODY> </HTML> errorPage.jsp <%@ page isErrorPage="true" %> <HTML>     <HEAD>         <TITLE>An Error Page Using the exception Object</TITLE>     </HEAD>     <BODY>         <H1>An Error Page Using the exception Object</H1>         An error occurred: <%= exception.toString() %>     </BODY> </HTML>