List of Listings – Seam in Action

List of Listings

Chapter 1. Seam unifies Java EE

Listing 1.1. The JPA entity class that represents a golf tip

Listing 1.2. The action listener for the JSF view

Listing 1.3. An end-to-end test of the golf tips application using the Seam test framework

Chapter 2. Putting seam-gen to work

Listing 2.1. Responding to the seam-gen setup questionnaire

Listing 2.2. Creating a new project with seam-gen

Listing 2.3. Reverse engineering the database to create entities and session beans

Listing 2.4. Customizes property names of entity classes and adds extra methods

Listing 2.5. Filters tables and establishes missing relationships

Listing 2.6. Method that sets the sort order for the course list

Listing 2.7. Incremental redeployment as reported by the development classloader

Listing 2.8. TeeSet and Hole collections ordered according to golf regulation

Chapter 3. The Seam life cycle

Listing 3.1. A field in a JSF form using standard markup

Listing 3.2. A JSF form field decorated by the layout/edit.xhtml composition template

Listing 3.3. The layout/edit.xhtml composition template for input fields

Listing 3.4. Contextual navigation rule consulted after persisting a facility

Listing 3.5. URL rewrite configuration for friendly URLs

Listing 3.6. Configuration for capturing authorization exceptions

Chapter 4. Components and contexts

Listing 4.1. The Golfer entity class as a Seam component

Listing 4.2. The Member entity class, a superclass for application user types

Listing 4.3. A Seam JavaBean component that holds and verifies a new password

Listing 4.4. The Seam component that handles the member registration

Listing 4.5. A TestNG-based Seam integration test

Listing 4.6. The golfer registration form

Listing 4.7. Using the Seam API to access dependent component instances

Listing 4.8. Using the Seam API and the EL in an integration test

Chapter 5. The Seam component descriptor

Listing 5.1. A component descriptor with two component definitions

Listing 5.2. The PasswordBean defined using a component namespace

Listing 5.3. A configurable component used to hash plain-text passwords

Listing 5.4. Component configuration using custom XML attribute and element names

Listing 5.5. A component that relies on static injection of dependent components

Chapter 6. Absolute inversion of control

Listing 6.1. The registration component refactored to use dynamic injection

Listing 6.2. A component that supports a clickable list of golfers

Listing 6.3. An internal method call that checks whether the username is available

Listing 6.4. A factory component that produces a list of new golfers

Listing 6.5. A component that manages the collection of new golfers

Listing 6.6. A factory component that uses a manager component as a data provider

Chapter 7. The conversation: Seam’s unit of work

Listing 7.1. A table-based conversation switcher component

Listing 7.2. A conversation-scoped component used for comparing courses

Chapter 8. Understanding Java persistence

Listing 8.1. A Java persistence entity class

Listing 8.2. A JPA persistence unit descriptor

Chapter 9. Seam-managed persistence and transactions

Listing 9.1. Verifies the persistence configuration at startup

Listing 9.2. A component that supports an application transaction

Chapter 10. Rapid Seam development

Listing 10.1. The Round entity class

Listing 10.2. aliasThe editor form for a golf round

Listing 10.3. The panel showing the tee set associated with the round

Listing 10.4. The panel that renders the details of a round

Listing 10.5. The entity class representing a comment on a course

Listing 10.6. The CourseHome component configured to use custom messages

Listing 10.7. A table showing the results of the query that fetches the list of rounds

Chapter 11. Securing Seam applications

Listing 11.1. An authentication component that plugs into Seam’s JAAS login module

Listing 11.2. An authentication component used for HTTP Digest authentication

Listing 11.3. Rules that allow a user to modify a facility under certain conditions

Listing 11.4. Security rule definitions for securing access to Facility entities

Chapter 12. Ajax and JavaScript remoting

Listing 12.1. A component that manages and renders the leaderboards

Listing 12.2. A JavaScript remoting-capable JavaBean component

Listing 12.3. A remoting-capable component for working with Favorite entities

Listing 12.4. Remoting logic used to add an entity as a favorite

Chapter 13. File, rich rendering, and email support

Listing 13.1. Resizing the profile image

Listing 13.2. The component that eagerly fetches the scorecard data

Listing 13.3. A simple PDF template that renders text, an image, and a list

Listing 13.4. The PDF template that renders the course scorecard

Listing 13.5. A component that pushes a dynamic document to the browser

Listing 13.6. A plain-text email message template

Listing 13.7. Mail service configuration for JBoss AS

Listing 13.8. An atom feed reporting scores from the latest rounds