File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes sensible way of sending error page to the client Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "sensible way of sending error page to the client" Watch "sensible way of sending error page to the client" New topic
Author

sensible way of sending error page to the client

Joshua Antony
Ranch Hand

Joined: Jun 05, 2006
Posts: 254
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?
Select 2 correct options.
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

Answer : A,C

All the options except E seem to be suitable, then why A,C? Can somebody please explain


SCJP,SCWCD, Into ATG now!
Marc Peabody
pie sneak
Sheriff

Joined: Feb 05, 2003
Posts: 4727

Hi Joshua, please don't forget to Quote Your Sources!


A good workman is known by his tools.
Joshua Antony
Ranch Hand

Joined: Jun 05, 2006
Posts: 254
This question is from Java Beat mock
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: sensible way of sending error page to the client