Multiple choice technology security

List the correct entries in the web.xml deployment descriptor for Exception & Error Handling

  1. <error-page> <exception-type>java.lang.Throwable</exception-type> <location>/error.jsp</location> </error-page>

  2. <error-page> <error-code>500</error-code> <location>/error.jsp</location> </error-page>

  3. <error-page> <location>/error.jsp</location> </error-page>

  4. a & b

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

web.xml error-page configuration can handle both exceptions (via exception-type) and HTTP error codes (via error-code). Option A shows exception-type configuration for Throwable. Option B shows error-code configuration for 500 errors. Option C is missing required elements. Both A and B are correct entries.

AI explanation

The web.xml deployment descriptor supports declaring entries keyed either by a specific HTTP (like 500) or by a Java (like `java.lang.Throwable` to catch any uncaught exception), both mapped to a such as an error JSP. Since both forms (a and b) are valid, correctly-formed error-page declarations, the combined option is the right choice; an `` with neither an error-code nor exception-type (option c) is not valid.