Friday, January 22, 2010

JSF PhaseListener Example

I have been reading a book called JSF 1.2 Components from Packt Publishing to do a review. While reading the book, I thought about the numerous code examples that I have written over the years. I decided to publish this example based on JSF 1.2 and Facelets 1.1.14 using NetBeans 6.7.1.

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

4 comments :

Popular Posts