File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes How to recognise errors and construct a page corrosponding to that error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to recognise errors and construct a page corrosponding to that error" Watch "How to recognise errors and construct a page corrosponding to that error" New topic
Author

How to recognise errors and construct a page corrosponding to that error

Rinku Sharma
Greenhorn

Joined: Mar 30, 2001
Posts: 18
hi ,
I am not able to catch the errors thrown by the JSP page and construct an error page corrosponding to that. I have made an error page also which i am calling from my main Jsp page but how do i catch the runtime errors if any .
URGENT
Amit
maha anna
Ranch Hand

Joined: Jan 31, 2000
Posts: 1467
Amit,
Assume main.jsp is the main jsp file which may create some runtime exceptions and errorHandle.jsp is your error catcher!
When an exception is created in main.jsp, the corresponding "errorPage" arrtibute file in <@page directive is called .The details of the exception are available with a pre-defined object named "exception" to the errorHandle.jsp.
Here is a sample code.

 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to recognise errors and construct a page corrosponding to that error