Hi,

 

I have implemented a very simple phaseListener as follows. It seems to be working, but the output is very puzzling. It seems to indicate all phases are being executed twice, or that the phase listener is being invoked twice on each phase. Can someone explain this?

 

Many thanks.

 

Regards,

Yee

 

----------------------------------------------------

 

public class PhaseTracker implements PhaseListener {

 

      private static final Logger logger = Logger.getLogger("com.test.web");

 

      public PhaseId getPhaseId() {

PhaseId.ANY_PHASE;

      }

 

      public void beforePhase(PhaseEvent e) {

            logger.info("BEFORE " + e.getPhaseId());

      }

 

      public void afterPhase(PhaseEvent e) {

            logger.info("AFTER " + e.getPhaseId());

      }

}

 

 

18:22:04,893 DEBUG FacesServlet:99 - service begin

7/12/2005 18:22:08 com.test.web.util.PhaseTracker beforePhase

INFO: BEFORE RESTORE_VIEW(1)

7/12/2005 18:22:25 com.test.web.util.PhaseTracker beforePhase

INFO: BEFORE RESTORE_VIEW(1)

7/12/2005 18:23:30 com.test.web.util.PhaseTracker afterPhase

INFO: AFTER RESTORE_VIEW(1)

7/12/2005 18:24:06 com.test.web.util.PhaseTracker afterPhase

INFO: AFTER RESTORE_VIEW(1)

7/12/2005 18:24:24 com.test.web.util.PhaseTracker beforePhase

INFO: BEFORE APPLY_REQUEST_VALUES(2)

7/12/2005 18:26:23 com.test.web.util.PhaseTracker beforePhase

INFO: BEFORE APPLY_REQUEST_VALUES(2)

7/12/2005 18:26:26 com.test.web.util.PhaseTracker afterPhase

INFO: AFTER APPLY_REQUEST_VALUES(2)

7/12/2005 18:26:52 com.test.web.util.PhaseTracker afterPhase

INFO: AFTER APPLY_REQUEST_VALUES(2)

7/12/2005 18:26:52 com.test.web.util.PhaseTracker beforePhase

INFO: BEFORE PROCESS_VALIDATIONS(3)

7/12/2005 18:26:52 com.test.web.util.PhaseTracker beforePhase

INFO: BEFORE PROCESS_VALIDATIONS(3)

7/12/2005 18:26:53 com.test.web.util.PhaseTracker afterPhase

INFO: AFTER PROCESS_VALIDATIONS(3)

7/12/2005 18:26:53 com.test.web.util.PhaseTracker afterPhase

INFO: AFTER PROCESS_VALIDATIONS(3)

7/12/2005 18:26:53 com.test.web.util.PhaseTracker beforePhase

INFO: BEFORE UPDATE_MODEL_VALUES(4)

7/12/2005 18:26:53 com.test.web.util.PhaseTracker beforePhase

INFO: BEFORE UPDATE_MODEL_VALUES(4)

7/12/2005 18:26:53 com.test.web.util.PhaseTracker afterPhase

INFO: AFTER UPDATE_MODEL_VALUES(4)

7/12/2005 18:26:53 com.test.web.util.PhaseTracker afterPhase

INFO: AFTER UPDATE_MODEL_VALUES(4)

7/12/2005 18:26:53 com.test.web.util.PhaseTracker beforePhase

INFO: BEFORE INVOKE_APPLICATION(5)

7/12/2005 18:26:53 com.test.web.util.PhaseTracker beforePhase

INFO: BEFORE INVOKE_APPLICATION(5)

 

Reply via email to