7. Instead of displaying the standard HTTP 404- NOT FOUND message for all bad requests to a web application, you want to display a customized page. Which of the following is the correct way to do this? (Select one)
a You have to check the
servlet container documentation and change the default error message file.
b You have to change your servlets to redirect the responses to your customized error message file.
c You have to specify the mapping of the error-code (404) and the customized error page in web.xml.
d You cannot do it in a standard way.
Answer: c
Explanation
You can map error codes to error pages just as you map exception types to error pages. The following web.xml snippet maps 404 to
V
but i am not sure which method will trigger the custom html page -
setStatus(SC_NOT_FOUND);
OR
sendError(SC_NOT_FOUND);
hth and also please anwer my question !