Class ELResolverInitPhaseListener
- All Implemented Interfaces:
PhaseListener
,Serializable
,EventListener
public class ELResolverInitPhaseListener extends Object implements PhaseListener
This class is used to register the Faces ELResolver
stack with the Jakarta Server Pages container.
We overload it a bit to set a bit on the ApplicationAssociate stating we've processed a request to indicate the appliation is fully initialized.
After the first request, this PhaseListener
will remove itself from all registered lifecycle instances
registered with the application.
- Since:
- 1.2
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description ELResolverInitPhaseListener()
-
Method Summary
Modifier and Type Method Description void
afterPhase(PhaseEvent event)
Handle a notification that the processing for a particular phase has just been completed.void
beforePhase(PhaseEvent event)
Handle a notification that the processing for a particular phase of the request processing lifecycle is about to begin.PhaseId
getPhaseId()
Return the identifier of the request processing phase during which this listener is interested in processingPhaseEvent
events.static void
populateFacesELResolverForJsp(Application app, ApplicationAssociate appAssociate)
protected void
populateFacesELResolverForJsp(FacesContext context)
Populate the FacesCompositeELResolver stack registered with JSP if a request is being processed for the very first time.static void
removeELResolverInitPhaseListener()
-
Constructor Details
-
ELResolverInitPhaseListener
public ELResolverInitPhaseListener()
-
-
Method Details
-
afterPhase
Handle a notification that the processing for a particular phase has just been completed.
When invoked, this phase listener will remove itself as a registered
PhaseListener
with allLifecycle
instances.- Specified by:
afterPhase
in interfacePhaseListener
- Parameters:
event
- the phase event.
-
beforePhase
Handle a notification that the processing for a particular phase of the request processing lifecycle is about to begin.
The implementation of this method currently calls through to
populateFacesELResolverForJsp(jakarta.faces.context.FacesContext)
.- Specified by:
beforePhase
in interfacePhaseListener
- Parameters:
event
- the phase event.
-
getPhaseId
Return the identifier of the request processing phase during which this listener is interested in processing
PhaseEvent
events. Legal values are the singleton instances defined by thePhaseId
class, includingPhaseId.ANY_PHASE
to indicate an interest in being notified for all standard phases.We return
PhaseId.ANY_PHASE
.- Specified by:
getPhaseId
in interfacePhaseListener
- Returns:
- the phase id.
-
populateFacesELResolverForJsp
Populate the FacesCompositeELResolver stack registered with JSP if a request is being processed for the very first time. At the application initialiazation time, an empty CompositeELResolver is registered with JSP because ELResolvers can be added until the first request is serviced.- Parameters:
context
- - theFacesContext
for the current request
-
populateFacesELResolverForJsp
public static void populateFacesELResolverForJsp(Application app, ApplicationAssociate appAssociate) -
removeELResolverInitPhaseListener
public static void removeELResolverInitPhaseListener()
-