You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.
The current JSF phase is represented by an instance of the PhaseId class (using the pre-Java 5 enum pattern).
JSF <= 1.2 does not provide access to the current JSF phase through the public API. Seam, however, maintains the current PhaseId in a ThreadLocal variable on the class org.jboss.seam.contexts.FacesLifecycle and exposes it through the following static method call:
PhaseId currentPhaseId = FacesLifecycle.getPhaseId();
In JSF 2.0, the current PhaseId will be accessible from the getCurrentPhaesId() instance method on the FacesContext.
PhaseId currentPhaseId = FacesContext.getCurrentInstance().getCurrentPhaseId();