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