SoFunction
Updated on 2025-04-04

JSP error handling

The following page will produce an exception:

<%@ page errorPage="" %>
<HTML>
<HEAD>
<TITLE>JSP 1.0 Error Page Demo</TITLE>
</HEAD>
<BODY>
<H1>JSP 1.0 Error Page Demo</H1>
<%
String s = null;
(); //This will give NullPointException exception
%>
</BODY>
</HTML>


The following page is called after an error:


<html>
<body bgcolor="black" text="#FFFFFF">
<%--@ page isErrorPage="true" --%>
<h1> Attenion the fellowing error occurs</h1><br>
<pre><%= () %></pre>
</body>

</html>