9 Replies Latest reply on Jul 18, 2010 3:04 AM by Boss Dida

    SeamPhaseListener events

    Pieter Martin Novice

      Hi,


      I am trying to observe the org.jboss.seam.afterPhase event from the SeamPhaseListener for the RESTORE_VIEW phase.


      Unfortunately the event is raised before the conversation context is restored. This means that I can not observe the event for the RESTORE_VIEW phase.


      Is there a way around this or is another event needed in the SeamPhaseListener after the conversation context is restored?


      In other words an event to be raised after



         public void afterPhase(PhaseEvent event)
         {
            log.trace( "after phase: " + event.getPhaseId() );
            
            try
            {
               raiseEventsAfterPhase(event);
               if ( isPortletRequest(event) )
               {
                  afterPortletPhase(event);
      
                  //RAISE ANOTHER EVENT HERE
                  raiseEventsAfterAfterPhase(event);
               }
               else
               {
                  afterServletPhase(event);
               }
            }
            catch (Exception e)
            {
               log.error("uncaught exception", e);
               try
               {
                  Exceptions.instance().handle(e);
                  // A redirect occurred inside the error handler, and we are in after
                  // phase, so we need to clean up now as there are no more after
                  // phases to be run
                  if ( event.getFacesContext().getResponseComplete() )
                  {
                     afterResponseComplete(event.getFacesContext());
                  }
               }
               catch (Exception ehe) 
               {
                  log.error("swallowing exception", e);
               }
            }
      
            FacesLifecycle.clearPhaseId();
            
         }
      
      



      Any guidance appreciated


      Cheers
      Pieter