Source Code : Deal with the errors
Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com.
Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com.
Click Here or search from google with Libraries Name you get jar file related it
Deal with the errors
// generateError.jsp
<%@ page errorPage="processError.jsp" %>
<%-- Declare the page to send errors to --%>
<%-- After clicking the button, it will call itself again the generate error --%>
<%-- This scriptlet checks a hidden field to see whether or not to throw an exception --%>
<%
String hiddenField = request.getParameter("hiddenValue");
if ( hiddenField.equals("error"))
throw new java.lang.NullPointerException();
%>
<HTML>
<HEAD><TITLE>Generate Error</TITLE></HEAD>
<BODY>
This page generates an error when you click the button.<P>
<FORM METHOD="POST" ACTION="generateError.jsp">
<INPUT TYPE="HIDDEN" NAME="hiddenValue" VALUE="error">
<INPUT TYPE="SUBMIT" VALUE="Generate exception!">
</FORM>
</BODY>
</HTML>
//Another JSP file: processError.jsp
<%@ page isErrorPage="true" %>
<HTML>
<HEAD><TITLE> Process Error</TITLE></HEAD>
<BODY>
<% if ( exception != null ) {
out.write("
An error occurred. This page is to tell you what you did wrong.
");
}
else {
out.write("
You have reached this page, but no error information is available.
");
}
%>
</BODY>
</HTML>
Thank with us