com.logicaldoc.web
Class MultiPageMessagesSupport

java.lang.Object
  extended by com.logicaldoc.web.MultiPageMessagesSupport
All Implemented Interfaces:
java.io.Serializable, java.util.EventListener, javax.faces.event.PhaseListener

public class MultiPageMessagesSupport
extends java.lang.Object
implements javax.faces.event.PhaseListener

Enables messages to be rendered on different pages from which they were set. To produce this behaviour, this class acts as a PhaseListener. This is performed by moving the FacesMessage objects:

  • After each phase where messages may be added, this moves the messages from the page-scoped FacesContext to the session-scoped session map.
  • Before messages are rendered, this moves the messages from the session-scoped session map back to the page-scoped FacesContext. Only messages that are not associated with a particular component are ever moved. These are the only messages that can be rendered on a page that is different from where they originated. * To enable this behaviour, add a lifecycle block to your faces-config.xml file. That block should contain a single phase-listener block containing the fully-qualified classname of this file.

    Author:
    Jesse Wilson
    See Also:
    Serialized Form

    Constructor Summary
    MultiPageMessagesSupport()
               
     
    Method Summary
     void afterPhase(javax.faces.event.PhaseEvent event)
              Handle a notification that the processing for a particular phase has just been completed.
     void beforePhase(javax.faces.event.PhaseEvent event)
              Handle a notification that the processing for a particular phase of the request processing lifecycle is about to begin.
     javax.faces.event.PhaseId getPhaseId()
              Return the identifier of the request processing phase during which this listener is interested in processing PhaseEvent events.
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    MultiPageMessagesSupport

    public MultiPageMessagesSupport()
    Method Detail

    getPhaseId

    public javax.faces.event.PhaseId getPhaseId()
    Return the identifier of the request processing phase during which this listener is interested in processing PhaseEvent events.

    Specified by:
    getPhaseId in interface javax.faces.event.PhaseListener

    beforePhase

    public void beforePhase(javax.faces.event.PhaseEvent event)
    Handle a notification that the processing for a particular phase of the request processing lifecycle is about to begin.

    Specified by:
    beforePhase in interface javax.faces.event.PhaseListener

    afterPhase

    public void afterPhase(javax.faces.event.PhaseEvent event)
    Handle a notification that the processing for a particular phase has just been completed.

    Specified by:
    afterPhase in interface javax.faces.event.PhaseListener


    Copyright © 2008-2010 Logical Objects. All Rights Reserved.