So far, we've looked at how to configure a Seam-based application to have secured pages that can have dynamic content that is available based upon different user roles. However, in most enterprise systems, it's useful to audit security events such as logging on and off.
Seam provides easy-to-use support for auditing security events via Seam events. At key stages during a user's security lifecycle (logging on, failing to log on, logging off, and so on), Seam events are triggered, and these can be captured within custom Seam components via the @Observer
annotation. Seam events are discussed further in Chapter 11.
To capture an event, we must develop a method that will be invoked when the event occurs, and then annotate the method with the @Observer
annotation and the name of the event being captured.
@Observer("event name") public void handleEvent() { }
In Seam, the following common security events are raised.
Event name |
Description |
---|---|
|