ErrorReportValve
This valve is used to post-process the generated response, and so will fire only after the basic valve has finished its processing. This is possible because its invoke()
method delegates to the remainder of the pipeline before actually doing any processing for itself.
If the response has already been committed, this valve does nothing more. This would be the case when a custom error resource has been found by the StandardHostValve
for a Throwable
or for a response status code and has been successfully dispatched using a RequestDispatcher
.
However, if the response has not yet been handled, this valve will provide the default handling behavior.
If there is a javax.servlet.error.exception
attribute on the request, then it marks this as an error response, and invokes response.sendError()
with an internal server error (500) status code.
It then retrieves the response's message, filters it, and generates the HTML for a default error page.
Note
You can have the ErrorReportValve
generate...