• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Handling server side exception

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ?
 
sethuraman sukumaran
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is this question too tough ?
reply
    Bookmark Topic Watch Topic
  • New Topic