<h:command button> and<h:command link>
<h:command Link value =”address details” action Listener =”#<empBean.displayAddressDetails}>”/>
<h:select many check box>
<h:select one menu>
<h:select boolean check box>
<h:select many menu>
<h:select one radio>
<h:select many list box>
<h:select one list box>
In JSF based web appl n it we send a request from client to server then faces servlet will process the request by following request processing life cycle. àIn JSF request processing life cycle includes the phases like restore view, apply Request values, process validations update model values, invoke application and render response In JSF based we apps the main purpose of phase listener is to read each & every phase in JSP request process in life cycle and gives notification before and after the at each and every phase If we want to use phase listener in JSF based web appl n we have to follow below steps
Step-1 Prepare phase listener implementation class
To prepare phase listener class we have to take on user defined class which must implement class to javax.faces event. Phase listener and implement all the methods of phase listener interface. àJavax. Faces. Event. Phase listener interface has the following methods
Where before phase() will be executed just before starting each and every phase Where after phase() will be executed just after completing each and every phase Where get phase Id() will return current phase Id value. Eg: Public class myphaseListener implements phase listener
Step-2 - Configure phase listener implementation class in faces- config.xml
The main intention to configure phase listener implementation class in faces- config.xml file is to give an interaction to faces servlet which class is having implementation for phase listener interface, in order to execute at each and every phase To configure phase listener implementation class in faces- config.xml file, we have to use the following lode <faces-config> <life cycle> <phase- listener>fully qualified listeners</phase- listener> </life cycle> </life config> [for example application on event handling refer hand out provide on 21st nov 2013]
You liked the article?
Like: 0
Vote for difficulty
Current difficulty (Avg): Medium
TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.