簡易 LifeCycleListener

package your.pkg.name;
 
import javax.faces.event.PhaseEvent;
import javax.faces.event.PhaseId;
import javax.faces.event.PhaseListener;
 
public class LifeCycleListener implements PhaseListener {
 
      private static final long serialVersionUID = 1L;
 
      public PhaseId getPhaseId() {
        return PhaseId.ANY_PHASE;
    }
 
    public void beforePhase(PhaseEvent event) {
        System.out.println("START PHASE " + event.getPhaseId());
    }
 
    public void afterPhase(PhaseEvent event) {
        System.out.println("END PHASE " + event.getPhaseId());
    }
 
}
 
Add the following lines to your faces-config
 
  <lifecycle>
    <phase-listener>your.pkg.name.LifeCycleListener</phase-listener>
</lifecycle>





この print 文をコードに記述すると LifeCycleListener がコンソールに XPage のLifeCycle の各フェーズを表示します。

Java
katoman
August 19, 2015 2:36 PM
Rating
0





No comments yetLogin first to comment...