request.getPortletSession().removeAttribute(VIEW_ID);
request.getPortletSession().setAttribute
(PREV_MODE, request.getPortletMode().toString());
}
ServletFacesContextImpl facesContext = (ServletFacesContextImpl) request
.getPortletSession().getAttribute(CURRENT_FACES_CONTEXT);
String viewId = (String) request.getPortletSession().getAttribute(VIEW_ID);
if (facesContext == null || viewId == null || sessionTimedOut(request)) {
setPortletRequestFlag(request);
nonFacesRequest(request, response);
return;
}
setPortletRequestFlag(request);
try {
// TODO: not sure if this can happen. Also double check this against spec section 2.1.3
if (facesContext.getResponseComplete())
return;
facesContext.setExternalContext
(makeExternalContext(request, response));
renderProtected(request, response, facesContext, true);
} catch (Throwable e) {
handleExceptionFromLifecycle(e);
}