This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Servlets and the fly likes error pages in web.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Servlets
Bookmark "error pages in web.xml" Watch "error pages in web.xml" New topic
Author

error pages in web.xml

Hanna Habashy
Ranch Hand

Joined: Aug 20, 2003
Posts: 532
hi all:
I am trying to add error handling in my web.xml file.
here is the code:
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/errorPage.jsp</location>
</error-page>
It is not working correctly. It catchs Exceptions, but not RuntimeExceptions.
I had to add another code:
<error-page>
<exception-type>java.lang.RuntimeException</exception-type>
<location>/errorPage.jsp</location>
</error-page>
RuntimeExeption exteds Exception. Shouldn't be cought without adding the second code.
thanks


SCJD 1.4<br />SCJP 1.4<br />-----------------------------------<br />"With regard to excellence, it is not enough to know, but we must try to have and use it.<br />" Aristotle
Bruce Jin
Ranch Hand

Joined: Sep 20, 2001
Posts: 671
RuntimeException, or a class derived from it, is different from other subclasses of Exception in that it is an UncheckedException.


BJ - SCJP and SCWCD
We love Java programming. It is contagious, very cool, and lot of fun. - Peter Coad, Java Design

Crazy Bikes created by m-Power
 
Have you checked out Aspose?
 
subject: error pages in web.xml
 
It's not a secret anymore!