Chapter 8. Events, interceptors and exception handling
- 8.1. Seam events
- 8.2. Page actions
- 8.3. Page parameters
- 8.4. Propagating request parameters
- 8.5. URL rewriting with page parameters
- 8.6. Conversion and Validation
- 8.7. Navigation
- 8.8. Fine-grained files for defining navigation, page actions and parameters
- 8.9. Component-driven events
- 8.10. Contextual events
- 8.11. Seam interceptors
- 8.12. Managing exceptions
To complement the contextual component model, there are two further basic concepts that facilitate the extremely loose coupling distinctive of Seam applications. The first is a strong event model, where events are mapped to event listeners with method-binding expressions like those in JavaServer Faces (JSF). The second is the pervasive use of annotations and interceptors to apply cross-cutting concerns to components that implement business logic.
8.1. Seam events
The Seam component model was developed for use with event-driven applications, specifically to enable the development of fine-grained, loosely-coupled components in a fine-grained eventing model. There are several event types in Seam:
- JSF events
- Seam page actions
- Seam component-driven events
- Seam contextual events
Each of these events is mapped to Seam components with JSF EL method-binding expressions. For a JSF event, this is defined in the JSF template:
<h:commandButton value="Click me!" action="#{helloWorld.sayHello}"/>