Multiple choice technology programming languages

Which of these are the correct fragment within the web-app element of deployment descriptor. Select the two correct answer.

  1. <error-page> <error-code>404</error-code> <location>/error.jsp</location> </error-page>

  2. <error-page> <exception-type>mypackage.MyException</exception-type> <error-code>404</error-code> <location>/error.jsp</location> </error-page>

  3. <error-page> <exception-type>mypackage.MyException</exception-type> <error-code>404</error-code> </error-page>

  4. <error-page> <exception-type>mypackage.MyException</exception-type> <location>/error.jsp</location> </error-page>

Reveal answer Fill a bubble to check yourself
A,D Correct answer
Explanation

Error-page configuration supports two formats: using error-code for HTTP status codes (option A) OR using exception-type for Java exceptions (option D). Both require a location element pointing to the error page. Options B and C incorrectly mix both error-code and exception-type in the same error-page element - only one should be specified per error-page entry.