Lightweight Java Web Application Development: Leveraging EJB3, JSF, POJO, and Seam

Dr. Michael Yuan

Norman Richards

Copyright © 2006, Michael Yuan and Norman Richards


Table of Contents

I. Getting Started
1. What is a Lightweight Web Application
1.1. The J2EE Way
1.2. What is a Lightweight Framework
1.2.1. POJOs as Components
1.2.2. Annotation-based Metadata for Services Configuration
1.2.3. Dependency Injection
1.2.4. Extensible Container Services
1.3. The JBoss Lightweight Development Framework
1.3.1. EJB3
1.3.1.1. Entity Beans
1.3.1.2. Session Beans
1.3.1.3. Message Driven Beans
1.3.2. JavaServer Faces (JSF)
1.3.3. JBoss Seam
1.4. Conclusion
2. A Complete Mini Application
2.1. The Data Model
2.2. The Business Logic
2.2.1. The Session Bean
2.2.2. Access the Database
2.3. The Web Pages
2.4. The JSF Backing Bean Component
2.4.1. Name the Backing Bean
2.4.2. Model the Form Data
2.4.3. Handle User Events
2.4.4. Page Navigation
2.5. Conclusions
3. Customization and Agile Deployment
3.1. Change the Application Name
3.2. Configure the EJB3 Components
3.2.1. Configure the Database
3.2.2. Initialize the Database
3.2.3. Specify Arbitrary JNDI Name for a Session Bean
3.3. Configure the Web Components
3.4. Agile Depolyment Cycles
3.4.1. Hot Deployment
3.4.2. Hot Deployment
3.5. Conclusions
II. An End-to-End Tutorial
4. Develop a Data Model
5. Make the Application Stateful
5.1. The HttpSession API
5.2. Session-scoped JSF Backing Bean
5.3. Communication between Stateful JSF Backing Beans
5.4. Stateful Session Bean
5.5. Conclusions
6. Transactions
6.1. Transaction Basics
6.1.1. Force Transaction Rollback
6.1.2. Order DVD
6.2. Handle Exceptions
6.2.1. Entity Bean Copy Constructors
6.3. Database Synchronization
6.4. Transaction Alternative
6.5. Conclusions
7. Security
7.1. Managed Security
7.1.1. Access Control for Web Pages
7.1.2. Security Annotations on Business Methods
7.2. Manage the Current User
7.2.1. Retrieve the Current User
7.2.2. Logout
7.3. Define the Security Domain
7.4. Use Relational Database Login Module
7.5. Enable HTTPS
7.5.1. Generate a Self-signed Certificate
7.5.2. Get a Signed Certificate from a Certification Authority
7.6. Conclusions
8. Validation
8.1. Basic Validation
8.2. Validators
8.3. Convertors
8.4. Conclusions
9. Asynchronous Processing
9.1. Message Driven Bean
9.2. MDB in Action
9.2.1. Send a message to a MDB
9.2.2. Respond to Messages
9.2.3. Receives the order verification result in asyncstore
9.2.4. Check messages from the web UI
9.3. JBoss Message Driven POJOs
9.4. Conclusions
III. Advanced Topics
10. Complex ORM
11. Extend Container Services
11.1. Interceptor Basics
11.2. Class Level Interceptor: The Tracer Example
11.3. Method Level Interceptor: The SimulateDelay Example
11.4. Throw Exception in Interceptor: The SimulateFailure Example
11.5. Use Annotation to Drive Interceptors
11.6. Apply Interceptor to a Set of Methods At Once
11.7. Conclusions
12. Make the Application Scale
12.1. Clustering and Caching Basics
12.1.1. JGroups
12.1.2. JBoss Cache
12.2. Cluster Web Servers
12.2.1. Setup the load balancer
12.2.2. HTTP Session State Replication
12.2.3. Cluster-wide Single Sign-On
12.3. Cache to Improve Database Performance
12.3.1. Cache Entity Objects
12.3.2. Cache Database Queries
12.4. Cache Generic Transient Data
12.5. Conclusions
13. Rich UI and AJAX
13.1. Rich Web UI Components
13.1.1. Install Tomahawk
13.1.2. Use the tabbed panels
13.1.3. Use popoup windows
13.2. AJAX Components
13.2.1. Installation
13.2.2. The AJAX Auto-Completion Text Field
13.2.3. Future of AJAX in JSF
13.3. Validators
13.4. Conclusions
IV. Seam
14. Integrate JSF with EJB3
15. Integrate Business Processes
A. Install and Deploy JBoss AS
A.1. JDK 5.0 is Required
A.2. Install JBoss AS
A.3. Deploy and Run Applications
B. Install and Run MySQL Database