This example demonstrates the use of a
PhaseListener which is set in the web.xml file. It also includes a component tree renderer which is also a PhaseListener. Facelets includes a component renderer for debugging purposes. You must include the <ui:debug/> tag in your xhtml file to use it.Note: The component renderer for debugging components has a Javascript error which was introduced in Facelets 1.1.12 through 1.1.14 which will not render the Component tree. You must use either Facelets 1.1.11 or 1.1.15.B1 to have the component tree render.
Here is the sample code on Bitbucket: JSFPhaseListeners