getFacesContextFactory().getFacesContext(mPortletConfig, request, response, lifecycle);
ExternalContext extCtx = context.getExternalContext();
// Use request from ExternalContext in case its been wrapped by an
// extension
RenderRequest extRequest = (RenderRequest) extCtx.getRequest();
scopeId = extRequest.getParameter(REQUEST_SCOPE_ID_RENDER_PARAM);
if (restoreBridgeRequestScopeData(context, scopeId))
{
// Because the Bridge is required to always save/restore the
// VIEW_STATE
// parameter -- always attempt a restore
extRequest = restoreActionParams(context);
// only restores if first render after action
// afterwards not restored from Bridge request scope
// rather its saved/restored by Faces.
restoreFacesView(context, scopeId);
}
// 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))
{