Java Reference
In-Depth Information
The output from this JSP is shown in Fig.
10.4
.
Fig. 10.4
Normal output from
JDBC.jsp
As in an earlier example from the previous chapter, our error page will simply
make use of the
exception
object's
toString
method to display the associated error
message and then allow a fresh attempt at data retrieval. The code for the error page
is shown below.
<!-- JDBCError.jsp -->
<%@ page isErrorPage="true" %>
<HTML>
<HEAD>
<TITLE>Error Page</TITLE>
<STYLE>body{text-align:center;}</STYLE>
</HEAD>
<BODY>
<BR><BR><BR>
<H3>Data Retrieval Error<BR><BR>
<P STYLE="color:red">
<%= exception.toString() %></P></H3>
<BR><BR><BR>
Search WWH ::
Custom Search