aspose file tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Handling server side exception Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Reply Bookmark "Handling server side exception" Watch "Handling server side exception" New topic
Author

Handling server side exception

sethuraman sukumaran
Greenhorn

Joined: Jul 14, 2004
Posts: 11
In my servlet class, I have a try-catch block to catch business exception that extends from Exception. In the catch block, I wrap it to the servlet exception and throw them.

I have two scenario's :

1. In web.xml I have mappings for both ServletException and the business exception. Which one will the container choose ?

2. In web.xml, I don't have a mapping for the business exception but I have only for ServletException. Will that path be taken ? I read in a book saying the container will use getRootCause() method on the ServletException that is thrown to get the wrapped exception. Then it will search for the matching exception type in web.xml

Can anyone help me out ?


Thanks & Regards,<br />Sethu.<br /> <br />SCJP 1.4 - 90%<br />SCWCD 1.4 - 88%
sethuraman sukumaran
Greenhorn

Joined: Jul 14, 2004
Posts: 11
Is this question too tough ?
 
I agree. Here's the link: jrebel
 
subject: Handling server side exception
 
Similar Threads
don't understand this question
JavaBeat question. error-page
Doubt on send Error
Exception Handling
error page doubt