1 Reply Latest reply on Jul 22, 2011 7:28 AM by richyclarke

    I'm newbie to richfaces . Is there anyway to debug and understand the life cycle of richfaces at runtime

    manimportal

      Hi All,

       

      I'm newbie to richfaces . Is there anyway to debug and understand the life cycle of richfaces at runtime

        • 1. Re: I'm newbie to richfaces . Is there anyway to debug and understand the life cycle of richfaces at runtime
          richyclarke

          Hi,

           

          You could add a phase listener and log what 

           

          Add the following to faces-config.xml:

           

           

              <lifecycle>

                    <phase-listener>

                com.yourorg.yourpackage.MyPhaseListener

                    </phase-listener>

              </lifecycle>

           

          Then implement a class that extends  PhaseListener to log what you want to see;

           

          public class MyPhaseListener implements PhaseListener {

          private final Logger log = Logger.getLogger(MyPhaseListener.class);

              @Override

            public void afterPhase(PhaseEvent event) {

              log.info("PHASE: After: "+event.getPhaseId());

            }

              @Override

            public void beforePhase(PhaseEvent event) {

              log.info("PHASE: Before: "+event.getPhaseId());

            }

              @Override

            public PhaseId getPhaseId() {

              return PhaseId.ANY_PHASE;

            }

          }

          Rich