Index     Next     
iPlanet Application Server Developer's Guide



Contents


Preface



Chapter 1 Developing Applications
Application Requirements
About the Application Programming Model
The Presentation Layer
Servlets
JSPs
HTML Pages
Client-Side JavaScript
The Business Logic Layer
Session Beans
Entity Beans
Message Driven Beans
The Data Access Layer
Effective iPlanet Application Guidelines
Presenting Data with Servlets and JSPs
Creating Reusable Application Code
Improving Performance
Scalability Planning
Modularizing Applications
Functional Isolation
Reusable Code
Prepackaged Components
Unique Names
Shared Framework Classes
Session and Security Issues


Chapter 2 Controlling Applications with Servlets
About Servlets
Servlet Data Flow
Servlet Types
About the Server Engine
Instantiating and Removing Servlets
Request Handling
Allocating Servlet Engine Resources
Dynamically Reloading Servlets at Runtime
Configuring Servlets for Deployment
Locating Servlet Files
Deploying Servlets
Designing Servlets
Choosing a Servlet Type
Create Standard or Non-Standard Servlets
Planning for Servlet Reuse
Creating Servlets
Servlet Files for an iPlanet Application
The Servlet's Class File
Creating the Class Declaration
Overriding Methods
Accessing Parameters and Storing Data
Handling Sessions and Security
Accessing Business Logic Components
Handling Threading Issues
Delivering Client Results
The Servlet's Deployment Descriptor
Elements
Changing Configuration Files
iPlanet Application Server Optional Features
Invoking Servlets
Calling a Servlet With a URL
Invoking Specific Application Servlets
Invoking Generic Application Servlets
Calling a Servlet Programmatically
Verifying Servlet Parameters


Chapter 3 Presenting Application Pages with JavaServer Pages
Introducing JSPs
How JSPs Work
Designing JSPs
Choosing a Component
Designing for Ease of Maintenance
Designing for Portability
Handling Exceptions
Creating JSPs
General Syntax
JSP Tags
Escape Characters
Comments
Directives
<%@ page%>
<%@ include%>
<%@ taglib... %>
Example
Scripting Elements
Declarations <%! ... %>
Expressions <%= ... %>
Scriptlets <%...%>
Actions
<jsp:useBean>
<jsp:setProperty>
<jsp:getProperty>
<jsp:include>
<jsp:forward>
<jsp:plugin>
Implicit Objects
Programming Advanced JSPs
Including Other Resources
Using JavaBeans
Accessing Business Objects
Deploying JSPs
Unregistered JSPs
Registered JSPs
Invoking JSPs
Calling a JSP With a URL
Invoking JSPs in a Specific Application
Invoking JSPs in a Generic Application
Invoking a JSP From a Servlet
JSP 1.1 Tag Summary
Directives
Expressions
Scriptlets
Comments
Bean-Related Actions
Other Actions
Modifying Custom Tags for JSP 1.1
Compiling JSPs: The Command-Line Compiler
Value-added Features
Custom Tag Extensions
Database Query Tag Library
LDAP Tag Library
Conditional Tag Library
Attribute Tag Library
JSP Load Balancing
JSP Page Caching


Chapter 4 Introducing Enterprise JavaBeans
What Enterprise JavaBeans Do
What is an Enterprise JavaBean?
Understanding Client Contracts
Understanding Component Contracts
Understanding JAR File Contracts
Understanding Enterprise Beans
Understanding Session Beans
Understanding Entity Beans
Understanding Message Driven Beans
MDB Properties
EJB Role in an iPlanet Application Server Application
Designing an Object-Oriented Application
Planning Guidelines
Using Session Beans
Using Entity Beans
Planning for Failover Recovery
Working with Databases
Deploying EJBs
Dynamically Reloading EJBs
Using the ejbc Compiler
Using JNDI to Reference an EJB


Chapter 5 Using Session EJBs to Manage Business Rules
Introducing Session EJBs
Session Bean Components
Creating the Remote Interface
Declaring vs. Implementing the Remote Interface
Creating the Class Definition
Session Timeout
Passivation and Activation
Creating the Home Interface
Additional Session Bean Guidelines
Creating Stateless or Stateful Beans
Accessing iPlanet Application Server Functionality
Serializing Handles and References
Managing Transactions
Accessing Databases
Session Bean Failover
How to Configure a Stateful Bean with Failover
How the Failover Process Works
Failover Guidelines
How Often Is the State Saved?
How the State Is Saved


Chapter 6 Building Entity EJBs
Introducing Entity EJBs
How an Entity Bean is Accessed
Entity Bean Components
Creating the Class Definition
Using ejbActivate and ejbPassivate
Using ejbLoad and ejbStore
Using setEntityContext and unsetEntityContext
Using ejbCreate Methods
Using Finder Methods
Declaring vs. Implementing the Remote Interface
Creating the Home Interface
Defining Create Methods
Defining Find Methods
Creating the Remote Interface
Additional Entity Bean Guidelines
Accessing iPlanet Application Server Functionality
Serializing Handles and References
Managing Transactions
Committing a Transaction
Commit Option C
Handling Concurrent Access
Container Managed Persistence
Full J2EE Support
Third Party O/R Mapping Tools
Full Example of a CMP Entity Bean
Using the Lightweight CMP Implementation
Creating the Deployment Descriptors by Hand
ejb-jar Deployment Descriptor
ias-ejb-jar Deployment Descriptor
CMP Bean Deployment Descriptor
Using the Deployment Tool


Chapter 7 Using Message Driven Beans
Introducing Message Driven Beans
How a Message Driven Bean is Accessed
Components of Message Driven Beans
Creating the Class Definition
Message Driven Bean Guidelines
Accessing iPlanet Application Server Functionality
Managing Transactions
Committing a Transaction
Accessing Databases
Using the Deployment Tool
J2EE Specific Deployment Descriptor Fields
Message Driven Bean Specific Parameters
Creating the Deployment Descriptors by Hand
Sample Deployment Descriptor File


Chapter 8 Handling Transactions with EJBs
Understanding the Transaction Model
Specifying Transaction Attributes in an EJB
Using Bean Managed Transactions


Chapter 9 Using JDBC for Database Access
Introducing JDBC
Supported Functionality
Understanding Database Limitations
Understanding the iPlanet Application Server Limitations
Supported Databases
Migrating 6.x DD XML files to 6.5
To Migrate 6.x Deployment Descriptor XML File
New XML Datasource Descriptors
Local Transactions
Oracle
Sybase
Global Transactions
DB2
MSSQL
Oracle
Sequelink
Sybase
Using JDBC in Server Applications
Using JDBC in EJBs
Managing Transactions with JDBC or javax.transaction.UserTransaction
Specifying Transaction Isolation Level
Using JDBC in Servlets
Handling Connections
Local Connections
Registering a Local Datasource
Global Connections
Registering a Global Datasource
Creating a Global Connection
Container Managed Local Connections
Registering a Container Managed Local Datasource
Working with JDBC Features
Working with Connections
Pooling Connections
Working with ResultSet
Concurrency Support
Updatable Result Set Support
Working with ResultSetMetaData
Working with PreparedStatement
Working with CallableStatement
Handling Batch Updates
Creating Distributed Transactions
Working with RowSet
Using iASRowSet
Using CachedRowSet
Creating a RowSet
Using JNDI for a Database Driver


Chapter 10 Developing and Deploying CORBA-Based Clients
Overview of CORBA Client Support
Scenarios
Stand-Alone Program
Server-to-Server
Architectural Overview
iPlanet Value-Added Features
Naming Services
C++ Client Support
Built-in ORB and Third Party ORB Support
Basic Authentication and EJB Container Integration
Client Side Authentication
Load Balancing
Scalability
High Availability
Minimal Ports Opened in Firewalls
Limitations
Choosing the ORB
RMI/IIOP Client Applications
Developing RMI/IIOP Client Applications
JNDI Lookup for the EJB Home Interface
Client Authentication
Client-Side Load Balancing and Failover
Packaging RMI/IIOP Client Applications
Using the Assembly Tool GUI
Automating Reassembly Using Ant
Using Application Client Container (ACC)
Configuring RMI/IIOP Support
Server Configuration
Client Configuration
Deploying RMI/IIOP Client Applications
Client Deployment
Deployment Tools
Server CLASSPATH Setting (SP2 and Prior)
Configuring RMI/IIOP Applications for ORBIX
References
Configuration Steps
Enabling Security
Running RMI/IIOP Client Applications
Troubleshooting RMI/IIOP Client Applications
Performance Tuning RMI/IIOP
Load Testing Approaches
Recognizing Performance Issues
Basic Tuning Approaches
Enhancing Scalability
Firewall Configuration for RMI/IIOP
Viewing RMI/IIOP Log Messages
Monitoring Logs on Windows
Monitoring Logs on UNIX
Sample RMI/IIOP Applications
Converter Sample Application
Other RMI/IIOP Sample Applications
C++ IIOP Client Applications (Unix Only)
Configuring C++ IIOP Applications for ORBIX
Requirements
References
Preparing for C++ Client Development
Data Type Assumptions and Limitations
Generating the IDL Files
Using J2SE 1.4 rmic 2
Using the OpenORB JavaToIDL Compiler
Generating CPP Files from IDL Files
Enabling Security for C++ IIOP Applications
Lookup for the EJB Home Interface
Client-Side Load Balancing and Failover
Configuring the IIOP Bridge
Deploying C++ IIOP Client Applications
Client Deployment
Server CLASSPATH Setting (SP2 and Prior)
Performance Tuning IIOP
Basic Tuning Approaches
Enhancing Scalability
Viewing IIOP Log Messages
Sample C++ IIOP Applications
Redeploying the Converter Sample for Use with a C++ Client


Chapter 11 Packaging for Deployment
Overview of Packaging and Deployment
Modules
Applications
Naming Standards
Assembling Modules and Applications
Sample Files
Assembling WAR Modules
Using the Command Line Interface (CLI)
Using the Deployment Tool
Using the Visual Café Plug-in
Assembling EJB JAR Applications
Using the Command Line Interface (CLI)
Using the Deployment Tool
Assembling RMI/IIOP Applications
Deploying Modules and Applications
Deployment by Module
Deployment by Application
Deploying RMI/IIOP Clients
Deploying Static Content
Tools for Deployment
The iasdeploy Command
The iPlanet Deployment Tool
The iPlanet Visual Café Plug-in
General Rules About Deployment
Redeploying an Application or Module
Deploying to an iPlanet Application Server Cluster
Access to Shared Frameworks
Introducing XML DTDs
J2EE Standard Descriptors
Creating Deployment Descriptors
Document Type Definition
The iPlanet Application Server Registry
A Globally Unique Identifier
Web Application XML DTD
Web Application Overview
Web Application XML DTD
Element for Specifying an iPlanet Application Server Web Application
EJB XML DTD
EJB JAR File Contents
Specifying Parameter Passing Rules
EJB iPlanet Application Server XML DTD
Elements for Specifying EJB-JAR
Elements for Specifying Enterprise Beans
Elements for Specifying Persistence Manager
Elements for Specifying Pool Manager
Elements for Specifying EJB Reference
Elements for Specifying Resource Reference
Elements for Specifying Role Mapping
Elements for Specifying Role Implementation
RMI/IIOP Client XML DTD
iPlanet Application Server RMI/IIOP Client XML DTD
Elements for Specifying EJB Reference Information
Elements for Specifying Resource Reference Information
Resource XML DTD
Datasource XML DTD
Element for Specifying Datasources
Element for Specifying iPlanet Application Server Resources
Elements for Specifying Resources
Elements for Specifying JDBC Datasources
RMI/IIOP Client Datasource XML DTD
Elements for Specifying Java Client Resources
Elements for Specifying JDBC Settings


Chapter 12 Creating and Managing User Sessions
Introducing Sessions
Sessions and Cookies
Sessions and URL Rewriting
Supported Tags and Attributes
The URL Rewriting Process
The Location Header
Order of the Cookies
Sessions and Security
How to Use Sessions
Creating or Accessing a Session
Examining Session Properties
Binding Data to a Session
Invalidating a Session
Controlling the Session Type
Sharing Sessions in a Distributed Environment
Sharing Sessions with AppLogics


Chapter 13 Writing Secure Applications
iPlanet Application Server Security Goals
iPlanet Application Server Specific Security Features
iPlanet Application Server Security Model
Web Client and URL Authorizations
Web Client Invocation of Enterprise Bean Methods
RMI/IIOP Client Invocation of Enterprise Bean Methods
Security Responsibilities Overview
Application Developer
Application Assembler
Application Deployer
Common Security Terminology
Authentication
Authorization
Role Mapping
Container Security
Programmatic Security
Declarative Security
Application Level Security
Servlet Level Security
EJB Level Security
User Authentication by Servlets
HTTP Basic Authentication
Secure Socket Layer Mutual Authentication
Form-Based Login
Programmatic Login
Form-Based vs. Programmatic Login
The IProgrammaticLogin Interface
The WebProgrammaticLogin Class
The EjbProgrammaticLogin Class
User Authorization by Servlets
Defining Roles
Referencing Security Roles
Defining Method Permissions
Sample Web Application DD
User Authorization by EJBs
Defining Roles
Defining Method Permissions
Security Role References
User Authentication for Single Sign-on
How to Configure for Single Sign-on
Single Sign-on Example
User Authentication for RMI/IIOP Clients
Guide to Security Information
User Information
Security Roles
Web Server to Application Server Component Security


Chapter 14 Taking Advantage of the iPlanet Application Server Features
Caching Servlet Results
Using a Startup Class
The IStartupClass Interface
Building the Startup Class
Deploying the Startup Class
How kjs Handles the StartupClass Object


Appendix A Using the Java Message Service
About the JMS API
JMS Messaging Styles
Enabling JMS and Integrating Providers
Using JMS in Applications
JNDI and Application Component Deployment
Connection Factory Proxy
Connection Pooling
User Identity Mapping
About Default Username
About Explicit User ID Map
ConnectionFactoryProxies and Application Created Threads
JMS Features Not Supported
JMS Administration
JMS Object Administration Tools
JNDI Properties for JMS Administration Tools
JMS Object Administration for IBM MQ
Connection Factory Proxy Administration
Creating a Proxy
Deleting a Proxy
Listing Proxy Parameters
User ID Map Administration
Connection Pooling Configuration
Sample Applications
Default JMS Provider


Appendix B Runtime Considerations
Runtime Environments
Standard Module Runtime Environment
Application Runtime Environment
The Classloader Hierarchy
Dynamic Reloading
Enabling Dynamic Reloading
Using Administration Tool
Modifying the Registry
Dynamic Reloading of Servlets and JSPs
Dynamic Reloading of EJBs
Limitations of Dynamic Reloading


Appendix C Sample Deployment Files
Application DD XML Files
Sample Application DD XML File
Web Application DD XML Files
Sample Web Application DD XML File
Sample iPlanet Application Server Web-App DD XML File
EJB-JAR DD XML Files
Sample J2EE EJB-JAR DD XML File
Sample iPlanet Application Server EJB-JAR DD XML File
iPlanet Application Server Client DD XML Files
RMI/IIOP Client DD XML Files
Resource DD XML Files
Glossary

Index


Index     Next     
Copyright © 2002 Sun Microsystems, Inc. All rights reserved.

Last Updated March 06, 2002