SECTION 4: DESIGNING AND DEVELOPING SERVLETS TO HANDLE SERVER-SIDE EXCEPTIONS

Section 4
4.1 For each of the following cases, identify correctly constructed code for handling business logic exceptions, and match that code with correct statements about the code's behavior: Return an HTTP error using the sendError response method; Return an HTTP error using the setStatus method.
4.2 Given a set of business logic exceptions, identify the following: The configuration that the deployment descriptor uses to handle each exception; How to use a RequestDispatcher to forward the request to an error page; Specify the handling declaratively in the deployment descriptor.
4.3 Identify the method used for the following: Write a message to the WebApp log; Write a message and an exception to the WebApp log.

Section 4 - Designing and Developing Servlets to Handle Server-side Exceptions

4.1 For each of the following cases, identify correctly constructed code for handling business logic exceptions, and match that code with correct statements about the code's behavior: Return an HTTP error using the sendError response method; Return an HTTP error using the setStatus method.

return an http error using sendError

return an http error using setStatus

4.2 Given a set of business logic exceptions, identify the following: The configuration that the deployment descriptor uses to handle each exception; How to use a RequestDispatcher to forward the request to an error page; Specify the handling declaratively in the deployment descriptor.

configuring deployment descriptor for error handling

configuring deployment descriptor for exception handling

using RequestDispatcher to forward to an error page: see section 1.6 above for details

forward:

Note: to get a request dispatcher object:

4.3 Identify the method used for the following: Write a message to the WebApp log; Write a message and an exception to the WebApp log.

writing a message to the Web App log:

writing a message and an exception to the Web App log:

Return to top