// save the original response
Object originalResponse = extContext.getResponse();
// replace the response with our wrapper
ViewHandlerResponseWrapper wrapped = getWrapper(extContext);
extContext.setResponse(wrapped);
try
{
// build the view by executing the page
extContext.dispatch(requestURI);
if (LOGGER.isLoggable(Level.FINE)) {
LOGGER.fine("After dispacthMessage to viewId " + requestURI);
}
}
finally
{
// replace the original response
extContext.setResponse(originalResponse);
}
// Follow the JSTL 1.2 spec, section 7.4,
// on handling status codes on a forward
if (wrapped.getStatus() < 200 || wrapped.getStatus() > 299) {
// flush the contents of the wrapper to the response
// this is necessary as the user may be using a custom
// error page - this content should be propagated
wrapped.flushContentToWrappedResponse();
return true;
}
// Put the AFTER_VIEW_CONTENT into request scope
// temporarily