HttpServletResponse response,
FilterChain chain)
throws IOException, ServletException {
Object current = request.getAttribute(CURRENT_RESPONSE_ATTRIBUTE);
LazyWriterResponse lazyResponse = new LazyWriterResponse(request, response);
try {
request.setAttribute(CURRENT_RESPONSE_ATTRIBUTE, lazyResponse);
chain.doFilter(request, lazyResponse);
} finally {
request.setAttribute(CURRENT_RESPONSE_ATTRIBUTE, current);
lazyResponse.getLazyWriter().writePending();
}
}