Configuring system event listeners

JSF 2.0 allows us to use system events. These are events that can be fired by arbitrary objects at arbitrary points during the request processing lifecycle. Since the number of these events is quite big, you will not see them entirely covered here, but the next five examples should clarify the basic aspects of system events. You can find all of them in the javax.faces.event package.

Using <f:event>

The easiest way to use system event listeners consists in passing the name of the managed bean method in the listener attribute of the <f:event> tag. For example, PostValidateEvent is a system event that gets fired after all components are validated. This can be useful to validate multiple components. Suppose, that a ...

Get Mastering JavaServer Faces 2.2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.