コード例 #1
0
  // TODO: Blog this (MultiPageMessagesSupport)
  public void beforePhase(final PhaseEvent event) {
    FacesContext facesContext = event.getFacesContext();
    this.saveMessages(facesContext);

    if (PhaseId.RENDER_RESPONSE.equals(event.getPhaseId())) {
      if (!facesContext.getResponseComplete()) {
        this.restoreMessages(facesContext);
      }
    }
  }
コード例 #2
0
 /*
  * Save messages into the session after every phase.
  */
 public void afterPhase(final PhaseEvent event) {
   if (!PhaseId.RENDER_RESPONSE.equals(event.getPhaseId())) {
     FacesContext facesContext = event.getFacesContext();
     this.saveMessages(facesContext);
   }
 }