Skip to Main Content
Mastering JavaServer Faces 2.2
book

Mastering JavaServer Faces 2.2

by Anghel Leonard
June 2014
Intermediate to advanced content levelIntermediate to advanced
578 pages
12h 2m
English
Packt Publishing
Content preview from Mastering JavaServer Faces 2.2

Configuring phase listeners

As the name suggests, a phase listener is capable to listen to the start and end of each of the six JSF life-cycle phases (a detailed diagram of how JSF phases interact with each other is available in Appendix, The JSF Life Cycle):

  • Restore the View phase
  • Apply the Request Values phase
  • Process the Validations phase
  • Update the Model Values phase
  • Invoke the Application phase
  • Render the Response phase

You can easily capture the events of each phase by following these three steps:

  1. Implementing the PhaseListener interface.
  2. Overriding the afterPhase, beforePhase, and getPhaseId methods.
  3. Configuring the phase listener in faces-config.xml.

A good point to start is a simple but useful PhaseListener that can be used to debug the phases. ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

JavaServer Faces

JavaServer Faces

Hans Bergsten

Publisher Resources

ISBN: 9781782176466Supplemental Content