edu.nrao.sss.webapp.faces
Class FacesMessagePhaseListener
java.lang.Object
edu.nrao.sss.webapp.faces.FacesMessagePhaseListener
- All Implemented Interfaces:
- Serializable, EventListener, PhaseListener
public class FacesMessagePhaseListener
- extends Object
- implements PhaseListener
This class attempts to retain FacesMessages that would other wise be lost
due to a panelDivider being resized. This class only listens to events for
the RENDER_RESPONSE phase. During the afterPhase() method, we cache all
existing FacesMessages in a Map keyed by the associated HttpSession's Id.
During the beforePhase() method, the request parameters are searched for a
parameter name ending in InPercent
. If such a parameter exists and
its value is an integer, then the messages found in the cache are added to
the FacesContext. Either way, the cache is cleared at the end of the
beforePhase() method to make sure we're not holding onto stale
FacesMessages.
- See Also:
- Serialized Form
Method Summary |
void |
afterPhase(PhaseEvent event)
Always caches all FacesMessages for possible later use in the beforePhase
method. |
void |
beforePhase(PhaseEvent event)
If the request has a parameter ending in "InPercent" defined to a
non-empty string (an integer to be exact), then add the cached
FacesMessages back to the FacesContext. |
PhaseId |
getPhaseId()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FacesMessagePhaseListener
public FacesMessagePhaseListener()
getPhaseId
public PhaseId getPhaseId()
- Specified by:
getPhaseId
in interface PhaseListener
beforePhase
public void beforePhase(PhaseEvent event)
- If the request has a parameter ending in "InPercent" defined to a
non-empty string (an integer to be exact), then add the cached
FacesMessages back to the FacesContext. Either way, empty the cache.
- Specified by:
beforePhase
in interface PhaseListener
afterPhase
public void afterPhase(PhaseEvent event)
- Always caches all FacesMessages for possible later use in the beforePhase
method.
- Specified by:
afterPhase
in interface PhaseListener
Copyright © 2009. All Rights Reserved.