- All Implemented Interfaces:
- javax.servlet.Filter
public class CommittedResponseHtmlErrorRecoveryFilter
extends Object
implements javax.servlet.Filter
A filter that attempts to handle errors that occur after the HTTP response has already been committed (eg. due to
Flush Head Early.)
For use where the default error handling (an HTTP 500 response rendered by InternalServerErrorServlet) won't suffice.
Our current strategy is to:
1. pre-render the standard error page HTML
2. wrap pre-rendered page in some magic javascript
3. dump the result into the middle of the response outputstream
We hope that the browser will execute the aforementioned magic javascript as soon as it sees it, which will destroy
and re-render the page client-side with the HTML we generated in (1.) above.
We must hope the user is a human that pays attention to what we're rendering, not a machine that pays attention to
the HTTP status code we've already transmitted (most likely 200 OK.)