This course is delivered using the published book “Seam in Action”.  Each student will receive a copy of this book along with complementary lectures and labs developed by Web Age Solutions.

Topics
 
  • Seam Component Model
  • Testing Seam Applications
  • Seam and JSF
  • Error Handling and Debugging
  • Seam with EJB 3.0 and JPA
  • Stateful Seam Applications
  • Seam Application Enhancements
  • Seam and AJAX
  • Using Seam without EJB
  • Seam Production Deployment
What you will learn
  After completing this course, the student should be able to:
  • Describe and leverage the various advantages of the Seam programming model.
  • Use Seam in combination with various technologies like JSF, EJB 3.0, JPA, and AJAX.
  • Use various development tools to work more efficiently with Seam applications.
  • Test Seam applications.
  • Solve common application programming problems using Seam techniques.
  • Apply rule-based security to Seam applications.
  • Describe how to use Seam without EJBs and the tradeoff when doing so.
  • Deploy Seam applications into a variety of production environments.
Audience
 

This class is meant for Java Enterprise programmers looking to write a new breed of Enterprise applications based on Seam.

Prerequisites
 

Since Seam is designed to integrate with Java EE 5 technologies, students should have a good familiarity with Java and Java Enterprise programming.  For those new to Java Enterprise or perhaps with prior J2EE 1.4 experience the following course should be taken before WA1627.

Duration
  3 days
Lab Setup Guide

Outline for Java Enterprise Programming with JBoss Seam 2 Training

1. Seam Unifies Java EE

 
  • Which framework should I use?
  • Seam's approach to unification
  • Your first swings with Seam
  • Seam's core competencies
 

2. Putting seam-gen to Work

 
  • The Open 18 prototype
  • Letting seam-gen do the initial work
  • Kick off your project with seam-gen
  • Deploying the project to JBoss AS
  • Show and tell, change, and repeat
  • Rapidly developing a seam-gen project
 

3. The Seam Life Cycle

 
  • Exploring how Seam participates in a request
  • The JSF life cycle sans Seam
  • Seam's page-oriented life-cycle additives
  • Combining page actions with navigation
  • The JSF life cycle with Seam
  • A try-catch block around the life cycle
 

4. Components and Contexts

 
  • Seam's contextual naming container
  • Sorting out components
  • Defining components using annotations
  • A comprehensive component example
  • A component's life
  • Using EJB 3 session beans in Seam
  • Accessing components
 

5. The Seam Component Descriptor

 
  • Defining components using XML
  • XML namespaces in the component descriptor
  • Configuring component properties
  • Component definitions vs. component configuration
  • Configuring and enabling built-in components
 

6. Absolute Inversion of Control

 
  • Bijection: dependency injection evolved
  • Dynamic dependency @In-jection
  • @Out-jecting context variables
  • Bypassing bijection
  • Component events
  • Custom method interceptors
  • Factory and manager components
 

7. Testing In Seam

 
  • Seam TestNG Integration
  • Embedded JBoss Container
  • SeamTest API
  • Mocking Seam Components
  • Simulating Bijection
  • Nested Classes of BaseSeamTest
  • Component Integration Testing
  • Simulating JSF Requests
 

8. The Conversation: Seam's Unit of Work

 
  • Learning to appreciate conversational state
  • The conversation context
  • Establishing conversation boundaries
  • Putting the conversation aside
  • Switching between conversations
  • Driving the conversation with a page flow
  • Ad hoc conversations
 

9. Entities and Java Persistence API

 
  • Objectives
  • Data Persistence
  • Java Persistence API
  • Entities
  • Session Beans Vs Entities
  • Entities
  • Persisting and Retrieving Data
  • Accessing Entities
  • EntityManager & Persistence Unit
  • Persistence Context
  • Entities - Example
  • persistence.xml Hibernate Provider
  • persistence.xml Open JPA Provider
  • persistence.xml - Toplink
  • Entity Instance Lifecycle
  • Creating EntityManager in Session EJB
  • Creating EntityManager in a Plain Java Class
  • Working With the EntityManager Interface
  • Transaction Basics
  • Entity Lifecycle
  • When is an Entity Managed or Detached?
  • Implementing the CRUD Pattern
  • Accessing Entities Using Stateless Session Beans
  • Inserting Data
  • Retrieving Data
  • Updating Data
  • Deleting Data
  • Merging Entities
  • Life-Cycle Callbacks
  • Example: Internal callback
  • External Callback Class
  • Listener Class - Example
  • Synchronizing with Databases
  • Entity Lookup
  • JPAQL (JPA Query Language)
  • Summary
 

10. Seam-managed Persistence and Transactions

 
  • Getting persistence context management right
  • Enhancing the capabilities of the persistence manager
  • Setting up a persistence unit in Seam
  • Seam's transaction support
 

11. Rapid Seam Development

 
  • A framework within a framework
  • Stateful CRUD using the Home component
  • Providing feedback
  • Smarter queries with the Query component
 

12. Securing Seam Applications

 
  • Authentication jump-start
  • Securing pages
  • Role-based authorization
  • Rule-based authorization using Drools
  • Separating the computers from the humans
 

13. Ajax and JavaScript Remoting

 
  • Using Ajax with JSF
  • Partial form submits
  • Ajax Push with ICEfaces
  • JavaScript remoting to Seam
  • Conversational remoting calls
  • Responding to GWT remoting calls
 

14. File, Rich Rendering, and Email Support

 
  • Uploading files and rendering dynamic images
  • PDF generation with iText
  • Quick and easy charting with JFreeChart
  • Composing email the Seam way
  • Customizing the UI with resource bundles
 

Appendix A. Overview of JSF

 
  • What is JavaServer Faces (JSF)?
  • Why Use JSF?
  • Nature of a JSF Application
  • The Sun Reference Implementation (RI)
  • JSF and MVC
  • Faces Servlet
  • Managed Bean
  • The View
  • A Simple JSF Application
  • The Input Form: form.jsp
  • The Result: thanks.jsp
  • The Controller: AddressBean
  • Page Flow or Navigation Rule
  • How Does the Application Work?
  • Under the Covers: The Rendered Form HTML
  • Under the Covers: The Layout Tree
 

Appendix B. Introduction to Facelets

 
  • Constructing and Rendering a View (JSP way)
  • Facelets
  • Getting Facelets
  • Using Facelets
  • Page Templates
  • Define a Page Template
  • Define a Template Client
  • Summary
 

Appendix C. AJAX Overview

 
  • Objectives
  • What is AJAX?
  • A Simple Example
  • The Old Way
  • The AJAX Way
  • Two Key Aspects of AJAX
  • What are the Advantages of the AJAX Approach?
  • AJAX Technologies
  • The Basic AJAX API
  • Creating the XMLHttpRequest Object
  • The XMLHttpRequest Object Basics
  • Complete Example
  • The Timeline
  • Review Questions
  • Review Answers