Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

error handling in web.xml

 
Hanna Habashy
Ranch Hand
Posts: 532
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 catch 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
 
Leandro Oliveira
Ranch Hand
Posts: 298
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!! I'm using tomcat 5.0 and it works!!
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!