context = getFacesContext(request, response, lifecycle, redirectParams);
ExternalContext extCtx = context.getExternalContext();
// Use request from ExternalContext in case its been wrapped by an
// extension
RenderRequest extRequest = (RenderRequest) extCtx.getRequest();
if (restoredScope)
{
// Because the Bridge is required to always save/restore the
// VIEW_STATE
// parameter -- always attempt a restore
extRequest = restoreActionParams(context);
}
// Ensure the ContentType is set before rendering
if (extCtx.getResponseContentType() == null)
{
response.setContentType(extRequest.getResponseContentType());
}
// ensure that isPostback attribute set if VIEW_STATE param exists
if (extCtx.getRequestParameterValuesMap().containsKey(ResponseStateManager.VIEW_STATE_PARAM))
{