HI,
I need clarification on implementing the PhaseListener class. The following is the two different overriding implementation for the PhaseListener.getPhaseId
@Override
public PhaseId getPhaseId() {
return PhaseId.ANY_PHASE;
}
and
@Override
public PhaseId getPhaseId() {
return PhaseId.RESTORE_VIEW;
}
What could be the significant difference in those two implementations?. What will be the impact?
As stated in the
PhaseListener#getPhaseId()
javadoc, this indicates for whichPhaseId
the currentPhaseListener
implementation should execute the implementedbeforePhase()
andafterPhase()
methods. In the first example, they will be executed on any phase and in the second example, they will be executed in theRESTORE_VIEW
phase only (which is the firstmost phase of the JSF lifecycle).