This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes don't understand this question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "don Watch "don New topic
Author

don't understand this question

Poonam Agarwal
Ranch Hand

Joined: May 12, 2008
Posts: 323
Which of the following is a sensible way of sending an error page to the client in case of a business exception that extends from java.lang.Exception?

Note: A business exception means a checked exception that an application throws upon encountering a violation of a business rule. For example, a withdrawAmount() method in Account class may throw NotEnoughFundsException. Here, NotEnoughFundsException is a business exception.

A. Catch the exception and use RequestDispatcher to forward the request to the error page.
B. Don't catch the exception and define the 'exception to error-page' mapping in web.xml
C. Catch the exception, wrap it into ServletException and define the 'business exception to error-page' mapping in web.xml
D. Catch the exception, wrap it into ServletException, and define the 'ServletException to error-page' mapping in web.xml
E. Don't do anything, the servlet container will automatically send a default error page.

Please rancher help me understand this question. I totaly confused with the given correct options. A, C


Thanks <br />Poonam Agarwal SCWCD 86%
 
GeeCON Prague 2014
 
subject: don't understand this question