O'Reilly logo

Mastering JavaServer Faces 2.2 by Anghel Leonard

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Configuring action listeners

Action listeners are a great facility provided by JSF for dealing with action events. Commonly, action listeners are attached to command buttons (<h:commandButton>) or command links (<h:commandLink>) using the actionListener attribute.

When a button/link is clicked, JSF calls the action listener during the Invoke Application phase. Notice that if you are using immediate="true", then the action listener is called during the Apply Request Values phase. The method, indicated as a listener, should be public, should return void, and should accept an ActionEvent object (this object can be used to access the component that invoked the action), which can perform specific tasks. When its execution has finished, JSF will call ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required