private static boolean isInPhase() { return FacesLifecycle.getPhaseId()!=null; }
@Override protected boolean isFacesContextActive() { return FacesContext.getCurrentInstance() != null && FacesLifecycle.getPhaseId() != null; }
private static PhaseId getPhaseId() { PhaseId phaseId = FacesLifecycle.getPhaseId(); if (phaseId==null) { throw new IllegalStateException("No phase id bound to current thread (make sure you do not have two SeamPhaseListener instances installed)"); } return phaseId; }
@Override protected void storeConversationToViewRootIfNecessary() { FacesContext facesContext = FacesContext.getCurrentInstance(); if ( facesContext!=null && (FacesLifecycle.getPhaseId()==PhaseId.RENDER_RESPONSE || FacesLifecycle.getPhaseId()==PhaseId.RESTORE_VIEW) ) { FacesPage.instance().storeConversation(); } }
/** * @deprecated since 7.10: JSF resources mechanism allows to detect resources already included in the page natively. */ @Deprecated public boolean mustIncludeResources() { FacesContext facesContext = FacesContext.getCurrentInstance(); if (facesContext != null) { PhaseId currentPhaseId = FacesLifecycle.getPhaseId(); if (currentPhaseId.equals(PhaseId.RENDER_RESPONSE)) { HttpServletRequest request = (HttpServletRequest) facesContext.getExternalContext().getRequest(); if (request.getAttribute(SELECT2_RESOURCES_MARKER) != null) { return false; } else { request.setAttribute(SELECT2_RESOURCES_MARKER, "done"); return true; } } } return false; }
private void storePageflowToViewRootIfNecessary() { FacesContext facesContext = FacesContext.getCurrentInstance(); if ( facesContext!=null && FacesLifecycle.getPhaseId()==PhaseId.RENDER_RESPONSE ) { FacesPage.instance().storePageflow(); } }
if (facesContext != null) if (FacesLifecycle.getPhaseId() == RESTORE_VIEW )