Addison Wesley - The J2EE Tutorial Second Edition
The J2EE Tutorial Second Edition
Table of Contents
Copyright
The Java Series
The Jini Technology Series
The Java Series, Enterprise Edition
Foreword
About This Tutorial
Who Should Use This Tutorial
Prerequisites
How to Read This Tutorial
About the Examples
Further Information
Typographical Conventions
Acknowledgments
Feedback
Chapter 1. Overview
Distributed Multitiered Applications
J2EE Containers
Web Services Support
Packaging Applications
Development Roles
J2EE 1.4 Platform APIs
Sun Java System Application Server Platform Edition 8
Chapter 2. Understanding XML
Introduction to XML
Generating XML Data
Designing an XML Data Structure
Summary
Chapter 3. Getting Started with Web Applications
Web Application Life Cycle
Web Modules
Configuring Web Applications
Duke's Bookstore Examples
Accessing Databases from Web Applications
Further Information
Chapter 4. Java API for XML Processing
The JAXP APIs
An Overview of the Packages
The Simple API for XML APIs
The Document Object Model APIs
The Extensible Stylesheet Language Transformations APIs
Using the JAXP Libraries
Where Do You Go from Here?
Chapter 5. Simple API for XML
When to Use SAX
Echoing an XML File with the SAX Parser
Adding Additional Event Handlers
Handling Errors with the Nonvalidating Parser
Displaying Special Characters and CDATA
Parsing with a DTD
Choosing Your Parser Implementation
Using the Validating Parser
Parsing a Parameterized DTD
Handling Lexical Events
Using the DTDHandler and EntityResolver
Further Information
Chapter 6. Document Object Model
When to Use DOM
Reading XML Data into a DOM
Displaying a DOM Hierarchy
Examining the Structure of a DOM
Constructing a User-Friendly JTree from a DOM
Creating and Manipulating a DOM
Validating with XML Schema
Further Information
Chapter 7. Extensible Stylesheet Language Transformations
Introducing XSL, XSLT and XPath
How XPath Works
Writing Out a DOM as an XML File
Generating XML from an Arbitrary Data Structure
Transforming XML Data with XSLT
Transforming from the Command Line with Xalan
Concatenating Transformations with a Filter Chain
Further Information
Chapter 8. Building Web Services with JAX-RPC
Setting the Port
Creating a Simple Web Service and Client with JAX-RPC
Types Supported by JAX-RPC
Web Service Clients
Web Services Interoperability and JAX-RPC
Further Information
Chapter 9. SOAP with Attachments API for Java
Overview of SAAJ
Tutorial
Code Examples
Further Information
Chapter 10. Java API for XML Registries
Overview of JAXR
Implementing a JAXR Client
Running the Client Examples
Using JAXR Clients in J2EE Applications
Further Information
Chapter 11. Java Servlet Technology
What Is a Servlet?
The Example Servlets
Servlet Life Cycle
Sharing Information
Initializing a Servlet
Writing Service Methods
Filtering Requests and Responses
Invoking Other Web Resources
Accessing the Web Context
Maintaining Client State
Finalizing a Servlet
Further Information
Chapter 12. JavaServer Pages Technology
What Is a JSP Page?
The Example JSP Pages
The Life Cycle of a JSP Page
Creating Static Content
Creating Dynamic Content
Expression Language
JavaBeans Components
Using Custom Tags
Reusing Content in JSP Pages
Transferring Control to Another Web Component
Including an Applet
Setting Properties for Groups of JSP Pages
Further Information
Chapter 13. JavaServer Pages Documents
The Example JSP Document
Creating a JSP Document
Identifying the JSP Document to the Container
Chapter 14. JavaServer Pages Standard Tag Library
The Example JSP Pages
Using JSTL
Core Tag Library
XML Tag Library
Internationalization Tag Library
SQL Tag Library
Functions
Further Information
Chapter 15. Custom Tags in JSP Pages
What Is a Custom Tag?
The Example JSP Pages
Types of Tags
Encapsulating Reusable Content Using Tag Files
Tag Library Descriptors
Programming Simple Tag Handlers
Chapter 16. Scripting in JSP Pages
The Example JSP Pages
Using Scripting
Disabling Scripting
Declarations
Scriptlets
Expressions
Programming Tags That Accept Scripting Elements
Chapter 17. JavaServer Faces Technology
JavaServer Faces Technology Benefits
What Is a JavaServer Faces Application?
Framework Roles
A Simple JavaServer Faces Application
User Interface Component Model
Navigation Model
Backing Bean Management
How the Pieces Fit Together
The Life Cycle of a JavaServer Faces Page
Further Information
Chapter 18. Using JavaServer Faces Technology in JSP Pages
The Example JavaServer Faces Application
Setting Up a Page
Using the Core Tags
Using the HTML Component Tags
Using Localized Messages
Using the Standard Converters
Registering Listeners on Components
Using the Standard Validators
Binding Component Values and Instances to External Data Sources
Referencing a Backing Bean Method
Using Custom Objects
Chapter 19. Developing with JavaServer Faces Technology
Writing Component Properties
Performing Localization
Creating a Custom Converter
Implementing an Event Listener
Creating a Custom Validator
Writing Backing Bean Methods
Chapter 20. Creating Custom UI Components
Determining Whether You Need a Custom Component or Renderer
Understanding the Image Map Example
Steps for Creating a Custom Component
Creating the Component Tag Handler
Defining the Custom Component Tag in a Tag Library Descriptor
Creating Custom Component Classes
Delegating Rendering to a Renderer
Handling Events for Custom Components
Chapter 21. Configuring JavaServer Faces Applications
Application Configuration Resource File
Configuring Beans
Registering Messages
Registering a Custom Validator
Registering a Custom Converter
Configuring Navigation Rules
Registering a Custom Renderer with a Render Kit
Registering a Custom Component
Basic Requirements of a JavaServer Faces Application
Chapter 22. Internationalizing and Localizing Web Applications
Java Platform Localization Classes
Providing Localized Messages and Labels
Date and Number Formatting
Character Sets and Encodings
Further Information
Chapter 23. Enterprise Beans
What Is an Enterprise Bean?
What Is a Session Bean?
What Is an Entity Bean?
What Is a Message-Driven Bean?
Defining Client Access with Interfaces
The Contents of an Enterprise Bean
Naming Conventions for Enterprise Beans
The Life Cycles of Enterprise Beans
Further Information
Chapter 24. Getting Started with Enterprise Beans
Creating the J2EE Application
Creating the Enterprise Bean
Creating the Application Client
Creating the Web Client
Mapping the Enterprise Bean References
Specifying the Web Client's Context Root
Deploying the J2EE Application
Running the Application Client
Running the Web Client
Modifying the J2EE Application
Chapter 25. Session Bean Examples
The CartBean Example
A Web Service Example: HelloServiceBean
Other Enterprise Bean Features
Using the Timer Service
Handling Exceptions
Chapter 26. Bean-Managed Persistence Examples
The SavingsAccountBean Example
Mapping Table Relationships for Bean-Managed Persistence
Primary Keys for Bean-Managed Persistence
deploytool Tips for Entity Beans with Bean-Managed Persistence
Chapter 27. Container-Managed Persistence Examples
Overview of the RosterApp Application
The PlayerBean Code
Method Invocations in RosterApp
Building and Running the RosterApp Example
A Guided Tour of the RosterApp Settings
Primary Keys for Container-Managed Persistence
Advanced CMP Topics: The OrderApp Example
deploytool Tips for Entity Beans with Container-Managed Persistence
Chapter 28. A Message-Driven Bean Example
Example Application Overview
The Application Client
The Message-Driven Bean Class
Deploying and Running SimpleMessageApp
deploytool Tips for Message-Driven Beans
deploytool Tips for Components That Send Messages
Chapter 29. Enterprise JavaBeans Query Language
Terminology
Simplified Syntax
Example Queries
Full Syntax
EJB QL Restrictions
Chapter 30. Transactions
What Is a Transaction?
Container-Managed Transactions
Bean-Managed Transactions
Summary of Transaction Options for Enterprise Beans
Transaction Timeouts
Isolation Levels
Updating Multiple Databases
Transactions in Web Components
Chapter 31. Resource Connections
JNDI Naming
DataSource Objects and Connection Pools
Database Connections
Mail Session Connections
URL Connections
Further Information
Chapter 32. Security
Overview
Realms, Users, Groups, and Roles
Web-Tier Security
Understanding Login Authentication
Installing and Configuring SSL Support
XML and Web Services Security
EJB-Tier Security
Application Client-Tier Security
EIS-Tier Security
Propagating Security Identity
What Is Java Authorization Contract for Containers?
Further Information
Chapter 33. The Java Message Service API
Overview
Basic JMS API Concepts
The JMS API Programming Model
Writing Simple JMS Client Applications
Creating Robust JMS Applications
Using the JMS API in a J2EE Application
Further Information
Chapter 34. J2EE Examples Using the JMS API
A J2EE Application That Uses the JMS API with a Session Bean
A J2EE Application That Uses the JMS API with an Entity Bean
An Application Example That Consumes Messages from a Remote J2EE Server
An Application Example That Deploys a Message-Driven Bean on Two J2EE Servers
Chapter 35. The Coffee Break Application
Common Code
JAX-RPC Coffee Supplier Service
SAAJ Coffee Supplier Service
Coffee Break Server
JavaServer Faces Version of Coffee Break Server
Building, Packaging, Deploying, and Running the Application
Chapter 36. The Duke's Bank Application
Enterprise Beans
Application Client
Web Client
Internationalization
Building, Packaging, Deploying, and Running the Application
Running the Clients
Appendix A. Java Encoding Schemes
Further Information
Appendix B. XML and Related Specs: Digesting the Alphabet Soup
Basic Standards
Schema Standards
Linking and Presentation Standards
Knowledge Standards
Standards That Build on XML
Summary
Appendix C. HTTP Overview
HTTP Requests
HTTP Responses
Appendix D. J2EE Connector Architecture
About Resource Adapters
Resource Adapter Contracts
Common Client Interface
Further Information
Glossary
About the Authors
CD-ROM Warranty
Index
index_SYMBOL
index_A
index_B
index_C
index_D
index_E
index_F
index_G
index_H
index_I
index_J
index_K
index_L
index_M
index_N
index_O
index_P
index_Q
index_R
index_S
index_T
index_U
index_V
index_W
index_X