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.
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%
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com