final IncludeResponseWrapper responseWrapper = new IncludeResponseWrapper(response);
try {
WrappedResponseHolder.setWrappedResponse(responseWrapper);
dispatcher.include(request, responseWrapper);
if (responseWrapper.getRedirectURL()!=null) {
return new IncludedContent(responseWrapper.getRedirectURL());
}
return new IncludedContent(responseWrapper.getContentType(), responseWrapper.getContent());
}
finally {
WrappedResponseHolder.setWrappedResponse(wrapped);
}
}