Class UIViewRoot

All Implemented Interfaces:
PartialStateHolder, StateHolder, TransientStateHolder, UniqueIdVendor, ComponentSystemEventListener, FacesListener, SystemEventListenerHolder, EventListener

public class UIViewRoot extends UIComponentBase implements UniqueIdVendor

UIViewRoot is the UIComponent that represents the root of the UIComponent tree. This component renders markup as the response to Ajax requests. It also serves as the root of the component tree, and as a place to hang per-view PhaseListeners.

For each of the following lifecycle phase methods:

Take the following action regarding PhaseListeners.

Initialize a state flag to false.

If getBeforePhaseListener() returns non-null, invoke the listener, passing in the correct corresponding PhaseId for this phase.

Upon return from the listener, call FacesContext.getResponseComplete() and FacesContext.getRenderResponse(). If either return true set the internal state flag to true.

If or one or more listeners have been added by a call to addPhaseListener(jakarta.faces.event.PhaseListener), invoke the beforePhase method on each one whose PhaseListener.getPhaseId() matches the current phaseId, passing in the same PhaseId as in the previous step.

Upon return from each listener, call FacesContext.getResponseComplete() and FacesContext.getRenderResponse(). If either return true set the internal state flag to true.

Execute any processing for this phase if the internal state flag was not set.

If getAfterPhaseListener() returns non-null, invoke the listener, passing in the correct corresponding PhaseId for this phase.

If or one or more listeners have been added by a call to addPhaseListener(jakarta.faces.event.PhaseListener), invoke the afterPhase method on each one whose PhaseListener.getPhaseId() matches the current phaseId, passing in the same PhaseId as in the previous step.