This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
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 Java 8 in Action this week in the Java 8 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
 
Similar Threads
JavaBeat question. error-page
Q: Appropriate Exception Handling in a servlet
Doubt on send Error
Exception Handling
don't understand this question