Last active
August 8, 2017 21:29
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.bluelotussoftware.jsf.phaselisteners; | |
import java.util.logging.Logger; | |
import javax.faces.event.PhaseEvent; | |
import javax.faces.event.PhaseId; | |
import javax.faces.event.PhaseListener; | |
/** | |
* | |
* @author John Yeary <jyeary@bluelotussoftware.com> | |
* @version 1.1 | |
*/ | |
public class PhasePrinterListener implements PhaseListener { | |
private static final Logger logger = Logger.getLogger("global"); | |
private static final long serialVersionUID = 3131268230269004403L; | |
/** | |
* Creates a new instance of PhasePrinterListener | |
*/ | |
public PhasePrinterListener() { | |
} | |
@Override | |
public void afterPhase(PhaseEvent event) { | |
logger.info("After - " + event.getPhaseId().toString()); | |
if (event.getPhaseId() == PhaseId.RENDER_RESPONSE) { | |
logger.info("Done with request!\n"); | |
} | |
} | |
@Override | |
public void beforePhase(PhaseEvent event) { | |
if (event.getPhaseId() == PhaseId.RESTORE_VIEW) { | |
logger.info("Processing new request!"); | |
} | |
logger.info("Before - " + event.getPhaseId().toString()); | |
} | |
@Override | |
public PhaseId getPhaseId() { | |
return PhaseId.ANY_PHASE; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment