The J2EETM Tutorial
Home
TOC
PREV TOC NEXT Search
Feedback

Preface

Who Should Use This Tutorial
About the Examples
Prerequisites for the Examples
Where to Find the Examples
How to Build and Run the Examples
Related Information
Typographical Conventions
Acknowledgments

Overview

Distributed Multitiered Applications
J2EE Application Components
Client Components
Application Clients
Web Browsers
Applets
JavaBeansTM Component Architecture
J2EE Server Communications
Thin Clients
Web Components
Business Components
Enterprise Information System Tier
J2EE Architecture
Containers and Services
Container Types
Packaging
Development Roles
J2EE Product Provider
Tool Provider
Application Component Provider
Enterprise Bean Creation
Web Component Creation
J2EE Application Client Creation
Application Assembler
Application Deployer and Administrator
Reference Implementation Software
Web Server
Database Access
J2EE APIs
Enterprise JavaBeans Technology 2.0
JDBCTM 2.0 API
Java Servlet Technology 2.3
JavaServer Pages (JSP) Technology 1.2
Java Message Service (JMS) 1.0
Java Transaction API (JTA) 1.0
JavaMailTM Technology 1.2
JavaBeans Activation Framework 1.0
Java API for XML (JAXP) 1.1
J2EE Connector API 1.0
Java Authentication and Authorization Service (JAAS) 1.0
Tools
Application Deployment Tool
Scripts

Getting Started

Setting Up
Getting the Example Code
Building the Example
Checking the Environment Variables
Starting the J2EE Server
Starting the deploytool
Creating the J2EE Application
Creating the Enterprise Bean
Coding the Enterprise Bean
Coding the Remote Interface
Coding the Home Interface
Coding the Enterprise Bean Class
Compiling the Source Files
Packaging the Enterprise Bean
Creating the J2EE Application Client
Coding the J2EE Application Client
Locating the Home Interface
Creating an Enterprise Bean Instance
Invoking a Business Method
ConverterClient Source Code
Compiling the Application Client
Packaging the J2EE Application Client
Specifying the Application Client's Enterprise Bean Reference
Creating the Web Client
Coding the Web Client
Compiling the Web Client
Packaging the Web Client
Specifying the Web Client's Enterprise Bean Reference
Specifying the JNDI Name
Deploying the J2EE Application
Running the J2EE Application Client
Running the Web Client
Modifying the J2EE Application
Modifying a Class File
Adding a File
Modifying the Web Client
Modifying a Deployment Setting
Common Problems and Their Solutions
Cannot Start the J2EE Server
Naming and Directory Service Port Conflict
Web Service Port Conflict
Compilation Errors
Ant Cannot Locate the Build File
The Compiler Cannot Resolve Symbols
J2EE Application Client Runtime Errors
The Client Cannot Find ConverterApp.ear
The Client Cannot Find the ConverterClient Component
The Login Failed
The J2EE Application Has Not Been Deployed
The JNDI Name is Incorrect
Web Client Runtime Errors
The Web Context in the URL is Incorrect
The J2EE Application Has Not Been Deployed
The JNDI Name is Incorrect

Session Beans

A Session Bean Example
Session Bean Class
The SessionBean Interface
The ejbCreate Methods
Business Methods
Home Interface
Remote Interface
Helper Classes
State Management Modes
Stateful Session Beans
Stateless Session Beans
Choosing Between Stateful and Stateless Session Beans
The Life Cycle of a Session Bean
The Stateful Session Bean Life Cycle
The Stateless Session Bean Life Cycle
Other Enterprise Bean Features
Accessing Environment Entries
Comparing Enterprise Beans
Passing an Enterprise Bean's Object Reference

Entity Beans

Characteristics of Entity Beans
Persistence
Bean-Managed Persistence
Container-Managed Persistence
Shared Access
Primary Key
A Bean-Managed Persistence Example
Entity Bean Class
The EntityBean Interface
The ejbCreate Method
The ejbPostCreate Method
The ejbRemove Method
The ejbLoad and ejbStore Methods
The Finder Methods
The Business Methods
Database Calls
Home Interface
Remote Interface
Tips for Running the AccountEJB Example
Setting Up the Database
Running the New Enterprise Bean Wizard
Deploying the J2EE Application
Running the J2EE Application
Mapping Table Relationships For Bean-Managed Persistence
One-to-One Relationships
Tips for Running the StorageBinEJB Example
One-to-Many Relationships
A Helper Class for the Child Table
Tips for Running the OrderEJB Example:
An Entity Bean for the Child Table
Tips for Running the SalesRepEJB Example:
Many-to-Many Relationships
Tips for running the EnrollerEJB example:
About Container-Managed Persistence
A Container-Managed Persistence Example
Primary Key Class
Creating a Primary Key Class
Class Requirements
Bean-Managed Persistence and the Primary Key Class
Container-Managed Persistence and the Primary Key Class
Getting the Primary Key
Handling Exceptions
The Life Cycle of an Entity Bean

Web Components

Web Component Life Cycle
Packaging Web Components
Creating a WAR
Adding a WAR to a J2EE Application
Adding a Web Component to a WAR
Configuring Web Components
Application-Level Configuration
Context Root
WAR-Level Configuration
Context Parameters
References to Environment Entries, Enterprise Beans, Resource Environment Entries, or Resources
Event Listeners
Error Mapping
Filter Mapping
Component-Level Configuration
Initialization Parameters
Specifying an Alias Path
Deploying Web Components
Executing Web Components
Updating Web Components

Java Servlet Technology

What is a Servlet?
The Example Servlets
Troubleshooting
Servlet Life Cycle
Monitoring Servlet Life Cycle Events
Defining The Listener Class
Specifying Event Listener Classes
Handling Errors
Sharing Information
Scope Objects
Controlling Concurrent Access to Shared Resources
Initializing a Servlet
Writing Service Methods
Getting Information From Requests
Constructing Responses
Filtering Requests and Responses
Defining the Filter Class
Specifying Filter Mappings
Invoking Other Web Resources
Including the Content of Another Resource in the Response
Transferring a Control to Another Web Component
Accessing the Web Context
Maintaining Client State
Accessing a Session
Associating Attributes with a Session
Notifying Objects That Are Added To a Session
Session Management
Session Tracking
Finalizing a Servlet
Tracking Service Requests
Providing a Clean Shutdown
Creating Polite Long-Running Methods

JavaServer PagesTM Technology

What is a JSP Page?
The Example JSP Pages
The Life Cycle of a JSP Page
Translation and Compilation
Execution
Buffering
Handling Errors
Initializing and Finalizing a JSP Page
Creating Static Content
Creating Dynamic Content
Using Objects Within JSP Pages
Implicit Objects
Application-Specific Objects
Shared Objects
JSP Scripting Elements
Declarations
Scriptlets
Expressions
Including Content in a JSP Page
Transferring Control to Another Web Component
Param Element
Including an Applet
Extending the JSP Language

JavaBeansTM Components in JSPTM Pages

JavaBeans Component Design Conventions
Why Use a JavaBeans Component?
Creating and Using a JavaBeans Component
Setting JavaBeans Component Properties
Retrieving JavaBeans Component Properties

Custom Tags in JSPTM Pages

What is a Custom Tag?
The Example Tags
Using Tags
Declaring Tag Libraries
Types of Tags
Simple Tags
Tags With Attributes
Tags With Bodies
Choosing Between Passing Information as Attributes or Body
Tags That Define Scripting Variables
Cooperating Tags
Defining Tags
Tag Handlers
Tag Library Descriptors
Listener Element
Tag Element
Simple Tags
Tag Handlers
Body-content Element
Tags With Attributes
Defining Attributes in a Tag Handler
Attribute Element
Attribute Validation
Tags With Bodies
Tag Handlers
Body-content Element
Tags That Define Scripting Variables
Tag Handlers
Providing Information About the Scripting Variable
Cooperating Tags
Examples
An Iteration Tag
JSP Page
Tag Handler
Tag Extra Info Class
A Template Tag Library
JSP Page
Tag Handlers
How Is a Tag Handler Invoked?

Transactions

What is a Transaction?
Container-Managed Transactions
Transaction Attributes
Transaction Attribute Values
Required
RequiresNew
Mandatory
NotSupported
Supports
Never
Summary of Transaction Attributes
Setting Transaction Attributes
Rolling Back a Container-Managed Transaction
Synchronizing a Session Bean's Instance Variables
Methods Not Allowed in Container-Managed Transactions
Bean-Managed Transactions
JDBC Transactions
JTA Transactions
Returning Without Committing
Methods Not Allowed in Bean-Managed Transactions
Summary of Transaction Options
Transaction Timeouts
Isolation Levels
Updating Multiple Databases

Security

Authentication
J2EE Users, Realms, and Groups
Managing J2EE Users and Groups
Authentication Mechanisms
Web-Tier Authentication
Configuring A Web Component's Authentication Mechanism
Using Hybrid Authentication to Enhance Confidentiality
Controlling Access to J2EE Resources
Controlling Access to Web Resources
Controlling Access to Enterprise Beans
Unprotected Resources
Client Authentication
Auto-Registration of Users
Web Client Authentication
Data Protection
Developing a Custom Web Tier User Authentication Interface
Application Client Authentication
Setting Component Security Identities
Capturing a Security Context (Servlet)
Container Authentication
Setting Up a Server Certificate
Configuring EJB Target Security Requirements
Configuring Resource Signon (Connectors)
Authorization
Declaring Roles
Declaring Method Permissions
Declaring Role References
Mapping Roles to J2EE Users and Groups
Linking Role References to Roles
Configuring J2SE Security Policy Files
Determining the Caller Identity
Making Portable Access Decisions Programmatically from Components
Protecting Messages
Application Scenarios
J2EE Application Client
Web Browser Client

Resource Connections

JNDI Names and Resource References
Definitions
Specifying a Resource Reference
Mapping a Resource Reference to a JNDI Name
Database Connections for Enterprise Beans
Coded Connections
How to Connect
When To Connect
Specifying Database Users and Passwords
Container-Managed Connections
Connection Pooling
Mail Session Connections
Tips for Running the ConfirmerEJB Example
URL Connections
Tips for Running the HTMLReaderEJB Example

J2EE Connector Technology

About Resource Adapters
Resource Adapter Contracts
Administering Resource Adapters
The Black Box Resource Adapters
Transaction Levels
Properties
Configuring JDBC Drivers
The Non-XA Black Box Adapters
The XA Black Box Adapters
Resource Adapter Tutorial
Setting Up
Deploying the Resource Adapter
Testing the Resource Adapter
Common Client Interface (CCI)
Overview of the CCI
Programming with the CCI
Database Stored Procedures
Mapping to Stored Procedure Parameters
Reading Database Records
Inserting Database Records
Writing a CCI Client
CCI Tutorial
Deploy the Resource Adapter
Set Up the Database
Create the J2EE Application
Test the Resource Adapter

HTTP Overview

HTTP Requests
HTTP Responses

J2EETM SDK Tools

J2EE Administration Tool
Cleanup Tool
Cloudscape Server
Starting and Stopping Cloudscape
Cloudscape Server Configuration
Cloudscape ij Tool
Deployment Tool
J2EE Server
Key Tool
Packager
EJB JAR File
Syntax
Example
Web Application WAR File
Syntax
Example: Creating a Simple WAR File
Example: Specifying Individual Content Files
Example: Specifying Servlets and JSP Files
Application Client JAR File
Syntax
Example
J2EE Application EAR File
Syntax
Example: Creating an EAR File
Example: Specifying the Runtime Deployment Descriptor
Resource Adapter RAR File
Syntax
Realm Tool
Runclient Script
Verifier
Command-Line Verifier
Stand-Alone GUI Verifier

Glossary

Home
TOC
PREV TOC NEXT Search
Feedback