public void handleResponse(MessageContext context, HandlersChain chain) throws Throwable {
HttpServletResponse originalResponse =
(HttpServletResponse)context.getAttributes().remove(ORIGINAL_RESPONSE_ATT_NAME);
if (originalResponse != null) {
HttpServletResponse response = context.getAttribute(HttpServletResponse.class);
response.flushBuffer();
response.setContentLength(((NoBodyResponse)response).getContentLenghtValue());
// set the original response on the context
context.setAttribute(HttpServletResponse.class, originalResponse);
}
chain.doChain(context);