About This Tutorial
Chapter 1: Overview
Distributed Multitiered Applications
Enterprise Information System Tier
UDDI and ebXML Standard Formats
Java EE Application Assembly and Deployment
Application Component Provider
Application Deployer and Administrator
Enterprise JavaBeans Technology
JavaServer Pages Standard Tag Library
JavaBeans Activation Framework
Java API for XML Web Services (JAX-WS)
Java Architecture for XML Binding (JAXB)
SOAP with Attachments API for Java
Java Database Connectivity API
Java Naming and Directory Interface
Java Authentication and Authorization Service
Simplified Systems Integration
Sun Java System Application Server Platform Edition 9
Starting and Stopping the Application Server
Starting and Stopping the Java DB Database Server
Debugging Java EE Applications
Part One: The Web Tier
Chapter 2: Getting Started with Web Applications
Mapping URLs to Web Components
Setting Initialization Parameters
Mapping Errors to Error Screens
Accessing Databases from Web Applications
Populating the Example Database
Creating a Data Source in the Application Server
Chapter 3: Java Servlet Technology
Handling Servlet Life-Cycle Events
Controlling Concurrent Access to Shared Resources
Getting Information from Requests
Filtering Requests and Responses
Programming Customized Requests and Responses
Including Other Resources in the Response
Transferring Control to Another Web Component
Associating Objects with a Session
Notifying Methods to Shut Down
Creating Polite Long-Running Methods
Chapter 4: JavaServer Pages Technology
Using Objects within JSP Pages
Immediate and Deferred Evaluation Syntax
Deactivating Expression Evaluation
JavaBeans Component Design Conventions
Creating and Using a JavaBeans Component
Setting JavaBeans Component Properties
Retrieving JavaBeans Component Properties
Including the Tag Library Implementation
Transferring Control to Another Web Component
Setting Properties for Groups of JSP Pages
Chapter 5: JavaServer Pages Documents
Including Directives in a JSP Document
Creating Static and Dynamic Content
Identifying the JSP Document to the Container
Chapter 6: JavaServer Pages Standard Tag Library
Internationalization Tag Library
Chapter 7: Custom Tags in JSP Pages
Encapsulating Reusable Content Using Tag Files
Evaluating Fragments Passed to Tag Files
Top-Level Tag Library Descriptor Elements
Declaring Tag Attributes for Tag Handlers
Declaring Tag Variables for Tag Handlers
Programming Simple Tag Handlers
Including Tag Handlers in Web Applications
How Is a Simple Tag Handler Invoked?
Tag Handlers for Tags with Attributes
Tag Handlers for Tags with Bodies
Tag Handlers for Tags That Define Variables
Chapter 8: Scripting in JSP Pages
Initializing and Finalizing a JSP Page
Programming Tags That Accept Scripting Elements
Chapter 9: JavaServer Faces Technology
JavaServer Faces Technology Benefits
What is a JavaServer Faces Application?
A Simple JavaServer Faces Application
Steps in the Development Process
Mapping the FacesServlet Instance
Adding Managed Bean Declarations
User Interface Component Model
User Interface Component Classes
The Life Cycle of a JavaServer Faces Page
Chapter 10: Using JavaServer Faces Technology in JSP Pages
The Example JavaServer Faces Application
The UIInput and UIOutput Components
The UIMessage and UIMessages Components
The UISelectItem, UISelectItems, and UISelectItemGroup Components
Referencing Localized Static Data
Converting a Component's Value
Registering Listeners on Components
Registering a Value-Change Listener on a Component
Registering an Action Listener on a Component
Binding Component Values and Instances to External Data Sources
Binding a Component Value to a Property
Binding a Component Value to an Implicit Object
Binding a Component Instance to a Bean Property
Binding Converters, Listeners, and Validators to Backing Bean Properties
Referencing a Backing Bean Method
Referencing a Method That Performs Navigation
Referencing a Method That Handles an Action Event
Referencing a Method That Performs Validation
Referencing a Method That Handles a Value-change Event
Chapter 11: Developing with JavaServer Faces Technology
Writing Properties Bound to Component Values
Writing Properties Bound to Component Instances
Writing Properties Bound to Converters, Listeners, or Validators
Implementing an Event Listener
Implementing Value-Change Listeners
Implementing the Validator Interface
Writing a Method to Handle Navigation
Writing a Method to Handle an Action Event
Writing a Method to Perform Validation
Writing a Method to Handle a Value-Change Event
Chapter 12: Creating Custom UI Components
Determining Whether You Need a Custom Component or Renderer
When to Use a Custom Component
Component, Renderer, and Tag Combinations
Understanding the Image Map Example
Why Use JavaServer Faces Technology to Implement an Image Map?
Understanding the Rendered HTML
Summary of the Application Classes
Steps for Creating a Custom Component
Creating Custom Component Classes
Specifying the Component Family
Enabling Component Properties to Accept Expressions
Delegating Rendering to a Renderer
Handling Events for Custom Components
Creating the Component Tag Handler
Setting Component Property Values
Defining the Custom Component Tag in a Tag Library Descriptor
Chapter 13: Configuring JavaServer Faces Applications
Application Configuration Resource File
Using the managed-bean Element
Initializing Properties using the managed-property Element
Registering Custom Error Messages
Registering Custom Localized Static Text
Registering a Custom Validator
Registering a Custom Converter
Registering a Custom Renderer with a Render Kit
Registering a Custom Component
Basic Requirements of a JavaServer Faces Application
Configuring an Application with a Deployment Descriptor
Including the Required JAR Files
Including the Classes, Pages, and Other Resources
Chapter 14: Internationalizing and Localizing Web Applications
Java Platform Localization Classes
Providing Localized Messages and Labels
Part Two: Web Services
Chapter 15: Building Web Services with JAX-WS
Creating a Simple Web Service and Client with JAX-WS
Requirements of a JAX-WS Endpoint
Coding the Service Endpoint Implementation Class
Building and Packaging the Service
Web Services Interoperability and JAX-WS
Chapter 16: Binding between XML Schema and Java Classes
Java Representation of XML Schema
Configuring and Running the Samples
About the Schema-to-Java Bindings
j2s-xmlAttribute-field Example
j2s-xmlSchemaType-class Example
Chapter 17: Streaming API for XML
Pull Parsing Versus Push Parsing
Comparing StAX to Other JAXP APIs
Choosing Between Cursor and Iterator APIs
Resources, Namespaces, and Errors
Sun's Streaming Parser Implementation
SJSXP Factories Implementation
Configuring Your Environment for Running the Samples
cursor Sample - CursorParse.java
cursor2event Sample - CursorApproachEventObject.java
event Sample - EventParse.java
filter Sample - MyStreamFilter.java
readnwrite Sample - EventProducerConsumer.java
writer Sample - CursorWriter.java
Chapter 18: SOAP with Attachments API for Java
Creating and Sending a Simple Message
Adding Content to the SOAPPart Object
Adding a Document to the SOAP Body
Manipulating Message Content Using SAAJ or DOM APIs
DOMExample.java and DOMSrcExample.java
Chapter 19: Java API for XML Registries
Using Taxonomies in JAXR Clients
Before You Compile the Examples
Using JAXR Clients in Java EE Applications
Coding the Application Client: MyAppClient.java
Coding the PubQuery Session Bean
Starting the Application Server
Compiling the Source Files and Packaging the Application
Running the Application Client
Part Three: Enterprise Beans
Chapter 20: Enterprise Beans
What Is a Message-Driven Bean?
What Makes Message-Driven Beans Different from Session and Entity Beans?
When to Use Message-Driven Beans
Defining Client Access with Interfaces
Deciding on Remote or Local Access
The Contents of an Enterprise Bean
Naming Conventions for Enterprise Beans
The Life Cycles of Enterprise Beans
The Life Cycle of a Stateful Session Bean
The Life Cycle of a Stateless Session Bean
The Life Cycle of a Message-Driven Bean
Chapter 21: Getting Started with Enterprise Beans
Compiling and Packaging converter
Creating the Application Client
Compiling the Application Client
Deploying the Java EE Application
Running the Application Client
Modifying the Java EE Application
Chapter 22: Session Bean Examples
Building and Packaging the CartBean Example
A Web Service Example: HelloServiceBean
The Web Service Endpoint Implementation Class
Stateless Session Bean Implementation Class
Building and Packaging helloservice
Building and Packaging timersession
Chapter 23: A Message-Driven Bean Example
Packaging, Deploying, and Running SimpleMessage
Creating the Administered Objects
Creating and Packaging the Application
Removing the Administered Objects
Creating Deployment Descriptors for Message-Driven Beans
Part Four: Persistence
Chapter 24: Introduction to the Java Persistence API
Requirements for Entity Classes
Persistent Fields and Properties in Entity Classes
Multiplicity in Entity Relationships
Direction in Entity Relationships
Chapter 25: Persistence in the Web Tier
Accessing Databases from Web Applications
Populating the Example Database
Creating a Data Source in the Application Server
Obtaining Access to an Entity Manager
Accessing Data From the Database
Chapter 26: Persistence in the EJB Tier
Overview of the order Application
Entity Mapped to More Than One Database Table
BLOB and CLOB Database Types in order
Building and Packaging the Application
Relationships in the roster Application
Automatic Table Generation in roster
Building and Packaging the roster Application
Chapter 27: The Java Persistence Query Language
Queries That Navigate to Related Entities
Queries with Other Conditional Expressions
BNF Grammar of the Java Persistence Query Language
Part Five: Services
Chapter 28: Introduction to Security in Java EE
Characteristics of Application Security
Security Implementation Mechanisms
Java SE Security Implementation Mechanisms
Java EE Security Implementation Mechanisms
Using Deployment Descriptors for Declarative Security
Securing the Application Server
Working with Realms, Users, Groups, and Roles
What is a Realm, User, Group, and Role?
Managing Users and Groups on the Application Server
Mapping Roles to Users and Groups
Establishing a Secure Connection Using SSL
Installing and Configuring SSL Support
Specifying a Secure Connection in Your Application Deployment Descriptor
Working with Digital Certificates
Enabling Mutual Authentication over SSL
Chapter 29: Securing Java EE Applications
Accessing an Enterprise Bean Caller's Security Context
Declaring Security Role Names Referenced from Enterprise Bean Code
Defining a Security View of Enterprise Beans
Using Enterprise Bean Security Annotations
Using Enterprise Bean Security Deployment Descriptor Elements
Deploying Secure Enterprise Beans
Enterprise Bean Example Applications
Example: Securing an Enterprise Bean
Discussion: Securing the Duke's Bank Example
Configuring Resource Adapter Security
Mapping an Application Principal to EIS Principals
Chapter 30: Securing Web Applications
Mapping Security Roles to Application Server Groups
Checking Caller Identity Programmatically
Declaring and Linking Role References
Defining Security Requirements for Web Applications
Declaring Security Requirements Using Annotations
Declaring Security Requirements in a Deployment Descriptor
Specifying a Secure Connection
Specifying an Authentication Mechanism
Examples: Securing Web Applications
Example: Basic Authentication with JAX-WS
Chapter 31: Securing Web Services
Securing Web Service Endpoints
Advantages of Message Security
Web Services Security Initiatives and Organizations
Using Message Security with Java EE
Using the Application Server Message Security Implementation
Using the Java WSDP XWSS Security Implementation
Chapter 32: The Java Message Service API
How Does the JMS API Work with the Java EE Platform?
Writing Simple JMS Client Applications
A Simple Example of Synchronous Message Receives
A Simple Example of Asynchronous Message Consumption
A Simple Example of Browsing Messages in a Queue
Running JMS Client Programs on Multiple Systems
Creating Robust JMS Applications
Using Basic Reliability Mechanisms
Using Advanced Reliability Mechanisms
Using the JMS API in a Java EE Application
Using @Resource Annotations in Java EE Components
Using Session Beans to Produce and to Synchronously Receive Messages
Managing Distributed Transactions
Using the JMS API with Application Clients and Web Components
Chapter 33: Java EE Examples Using the JMS API
A Java EE Application That Uses the JMS API with a Session Bean
Writing the Application Components
Creating and Packaging the Application
Running the Application Client
A Java EE Application That Uses the JMS API with an Entity
Overview of the Human Resources Application
Writing the Application Components
Creating and Packaging the Application
Running the Application Client
An Application Example That Consumes Messages from a Remote Java EE Server
Creating and Packaging the Modules
Deploying the EJB Module and Copying the Client
Running the Application Client
An Application Example That Deploys a Message-Driven Bean on Two Java EE Servers
Creating and Packaging the Modules
Running the Application Client
Chapter 34: Transactions
Container-Managed Transactions
Rolling Back a Container-Managed Transaction
Synchronizing a Session Bean's Instance Variables
Methods Not Allowed in Container-Managed Transactions
Methods Not Allowed in Bean-Managed Transactions
Transactions in Web Components
Chapter 35: Resource Connections
DataSource Objects and Connection Pools
Chapter 36: Connector Architecture
Part Six: Case Studies
Chapter 37: The Coffee Break Application
JAX-WS Coffee Supplier Service
Building, Packaging, Deploying, and Running the Application
Building, Packaging, and Deploying the JAX-WS Service
Building, Packaging, and Deploying the SAAJ Service
Building, Packaging, and Deploying the Coffee Break Server
Running the Coffee Break Client
Removing the Coffee Break Application
Chapter 38: The Duke's Bank Application
Protecting the Enterprise Beans
The Classes and Their Relationships
Protecting the Web Client Resources
Building, Packaging, Deploying, and Running the Application
Building the Duke's Bank Application
Running the Application Client
Appendix A: Java Encoding Schemes
About the Authors
Index