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 Exception Handling 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 "Exception Handling" Watch "Exception Handling" New topic
Author

Exception Handling

ravi janap
Ranch Hand

Joined: Nov 04, 2000
Posts: 389
Hi
Please verify the answers to this question:
How can you redirect the request from a servlet to another resource if the servlet encounters an exception?
Select 2 correct options
a.This cannot be done unless the exception is caught in the servlet.
b.By specifying a mapping between exception class and the resource in web.xml.
c.This can be done only if the exception is a subclass of javax.servlet.ServletException.
d.This can be done even if the exact class of the exception is not known at compile time.
The answer says 'B' & 'D' are the correct options.
Isn't 'A' correct option too since to redirect the request from a servlet to another resource if the servlet encounters an exception we use include or forward method of RequestDispatcher to include or forward to another resource and this cannot be done unless the exception is caught in the servlet.
Thanks
Ravi


SCJP, SCJD, SCWCD, SCBCD, SCEA
ravi janap
Ranch Hand

Joined: Nov 04, 2000
Posts: 389
Hi
There is a mistake in what has been mentioned in above question.
The correct options are B & C.
According to me A should also be a correct option. Offcourse the question says select two options.
Thanks
Ravi
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception Handling
 
Similar Threads
Redirect the request
redirect the request from a servlet to another resource
About Forward and Include method in Servlet
Jsp code doubt
Servlets JSP and Design FAQS