A simple 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

All code submitted to OpenNTF XSnippets, whether submitted as a "Snippet" or in the body of a Comment, is provided under the Apache License Version 2.0. See Terms of Use for full details.
No comments yetLogin first to comment...