WA1283 J2EE Programming Using Rational Application Developer (RAD) v6 Training and Courseware Course Outline

1. Introduction to Rational Application Developer

  • Objectives
  • The WebSphere Family
  • Eclipse Platform
  • The WebSphere Studio Product Family
  • Rational Web Developer
  • Rational Application Developer
  • Key Features in RAD v6.0
  • WebSphere Studio Application Developer Integration Edition
  • WebSphere Studio Enterprise Developer
  • Views, Perspective, and Editor Areas
  • Basic Operations with RAD Views and Perspectives
  • The Java Perspective
  • The Debug Perspective
  • Navigator View
  • Package Explorer
  • Outline View
  • Task and Problems View
  • Build and Validation
  • Import and Export Project
  • Templates and Code Completion
  • Searching
  • Setup Compiler Class Path
  • JRE Switching
  • Refactoring
  • Changing Class Name
  • Changing Method Name
  • Changing Variable Name
  • Moving a Class to a Different Package
  • Extracting Code to a Method
  • Pull-up Method
  • Migrating Workspace from WSAD v5.x
  • Project Interchange Feature
  • Migrating J2EE Applications
  • J2EE Migration Wizard
  • Summary
 

2. Introduction to J2EE and the WebSphere Platform

  • Objectives
  • Java Web Applications
  • Java Web Application Architecture
  • J2EE Architecture
  • J2EE Software Packaging
  • J2EE Module Structure
  • Enterprise Archive (EAR)
  • Web Modules and WAR
  • EJB Modules
  • Web Application Programming Model MVC
  • An MVC Example
  • The Infrastructure for Enterprise Web Applications
  • The IBM WebSphere Platform
  • Rational Application Developer (RAD)
  • Background of RAD
  • WebSphere Application Server
  • What s New in WebSphere Application Server v6.0
  • WebSphere Editions
  • Services Provided by WebSphere Application Server
  • WebSphere Application Server Architecture
  • WebSphere Administrative Topology
  • WebSphere Application Server Components
  • Server Profile
  • WAS Administration Tools
  • Administration Changes from v5
  • RAD J2EE Development
  • RAD Project Structure
  • Summary
 

3. J2EE Programming Tools

  • Objectives
  • Project Explorer
  • Servers View
  • The J2EE Perspective
  • The Web Perspective
  • Create an Enterprise Application
  • Setup Utility JAR
  • Create an EJB Project
  • Create a Web Project
  • Setup Dependent JAR Files
  • Create Server Instance and Server Configuration
  • Configure Server Instance
  • Add an Enterprise Application Project to the Test Server
  • Start and Stop the Server
  • Test a Servlet
  • Debug a servlet
  • Test a JSP
  • Debug a JSP
  • Summary
 

4. Servlet Basics

  • Objectives
  • History CGI
  • Server Extension APIs
  • Java Servlet
  • Servlet Container
  • Servlet Responsibilities
  • J2EE and Servlet
  • The Servlet Class
  • The HttpServlet Class
  • An Example Hello World
  • The Servlet Container
  • The Servlet API
  • Life Cycle Initialization
  • Life Cycle Initialization
  • Example Initialization
  • Life Cycle Processing
  • Life Cycle Processing
  • Life Cycle Destroy
  • User Input
  • Example User Input
  • Output to Client
  • Servlet Error Handling
  • Threading Issues
  • Create a Servlet in RAD
  • Code Servlet Methods
  • The Web Deployment Descriptor
  • Test the Servlet
  • Debug Servlets in the WebSphere Test Environment
 

5. JavaServer Page (JSP) Basics

  • Objectives
  • JavaServer Pages
  • A Simple Example - Hello.jsp
  • JSP Benefits
  • Evolution of Dynamic Content Technologies
  • How JSP Works
  • JSP Invocation
  • JSP Scripting Elements
  • The XML Syntax
  • JSP Directive
  • page Directive Attributes
  • page Directive an Example
  • page Attribute errorPage
  • page Attribute isErrorPage
  • Using XML Syntax
  • Directives include
  • Include an Example
  • Include an Example
  • Include at compile time vs. at request time
  • Request time inclusion
  • JSP Declarations
  • Declarations an Example
  • JSP Expressions
  • JSP Expressions an Example
  • JSP Scriptlets
  • JSP Scriptlets an Example
  • JSP Scriptlets an Example
  • JSP Comments
  • JSP Predefined Variables
  • The request Object
  • The response Object
  • The out Object
  • Out an Example
  • Creating a JSP with RAD
  • Editing a JSP with RAD
  • Testing a JSP with WSAD
  • Debugging a JSP with RAD
 

6. Servlet Interaction Interface

  • Objectives
  • Request
  • Request Parameters
  • Request Attributes
  • Request Headers
  • Request Path
  • Other Request Information
  • Response
  • Cookies
  • Setting Cookies
  • Servlet Context
  • Servlet Context Attributes
  • Resource
  • Session Tracking
  • Tracking Techniques
  • Cookies
  • Cookies an Example
  • HTML Hidden Fields
  • Using HttpSession
  • Session Invalidation
  • An Example of Session Tracking Code...
  • An Example of Session Tracking Code
  • An Example of Session Tracking Code
  • An Example of Session Tracking Code
  • An Example of Session Tracking Code
  • An Example of Session Tracking Code
  • An Example of Session Tracking Code
  • HttpSession - URL Rewriting
  • Summary
 

7. Servlet Programming Advanced

  • Objectives
  • Key Issues for Web Application Development Productivity
  • Web Application Programming Model MVC
  • Model
  • View
  • Controller
  • What is JDBC?
  • JDBC Architecture
  • JDBC: Basic Steps
  • Loading a Driver
  • DB2 UDB JDBC Drivers
  • Oracle JDBC Drivers
  • Create a Connection
  • Connection
  • Statement
  • PreparedStatement
  • ResultSet
  • ResultSet
  • ResultSet
  • Example JDBC Servlet With Transactions
  • Close the Connection
  • Need for Connection Pooling
  • Connection Pooling in JDBC 2.0
  • Connection Pooling
  • Basic Steps in Using JDBC Connection Pooling
  • Access a DataSource
  • Get a Connection
  • Release Connections
  • Connection Pool Example
  • Resource References
  • JavaBeans
  • MVC Implementation
  • Request Dispatching
  • Request Dispatching - Forward vs. Include
  • HTTP Redirection
  • Dispatch vs. redirection
  • Integrating Servlet and JSP
  • Calling a JSP from a Servlet
  • Request Dispatching - forward Request to JSP
  • Supply Result information to the JSP
  • A Simple Example
  • Display JavaBean Properties in JSP
  • Creating a Data Source with RAD
  • Adding Resource Reference in RAD
  • Create a Java Bean with RAD
  • Add Attributes and Getters and Setters with RAD
 

8. Using Java Beans with JSP

  • Objectives
  • What is a JavaBean?
  • Structure of a JavaBean
  • Life Cycle
  • Properties
  • Very Simple Bean
  • Using Java Beans in JSP
  • The <jsp:useBean> tag
  • Java Bean scope
  • <jsp:useBean> in Action
  • The <jsp:getProperty> tag
  • The <jsp:setProperty> tag
  • Mapping all the request parameters
  • Another Example
  • Mixing Scriptlets and Bean tags
 

9. JSP Expression Language and Standard Tag Library

  • JSP Expression Language (EL)
  • Basic Usage
  • Built-in Objects
  • Working With Arrays and Maps
  • Operators
  • Full Example
  • JSP Standard Tag Library (JSTL)
  • Run Time Version
  • Basic Tags
  • Condition Tags
  • Interator Tags
  • Internationalization (I18N)
  • Setting Preferred Locale
  • Specifying Resource Bundle
  • Display Translated Text
  • Display Number
  • Display Date
  • JDBC Tags
  • Specify Data Source
  • Performing a Query
  • Display Result
  • Pagination Example
 

10. Enterprise JavaBean (EJB) Overview

  • Objectives
  • Needs for EJB
  • Distributed Computing
  • Distributed Transaction
  • Distributed Security
  • What are EJBs?
  • Main Characteristics of EJBs
  • EJB Remote Method Call
  • EJB Architecture Components
  • EJB Client
  • EJB JAR File
  • EJB Server
  • EJB Container
  • EJB Container - Persistence
  • EJB Container - Transaction
  • Enterprise Java Beans
  • Session Beans
  • Entity Beans
  • EJB Classes and Interfaces
  • Basic Components of Entity and Session Beans
  • EJB Home Interface
  • An EJB Home Interface Example
  • EJBHome Object
  • EJB Remote Interface
  • Remote Interface Example
  • EJB Local Home Interface
  • EJB Local Interface
  • Remote EJB Objects
  • Local EJB Objects
  • EJB Implementation Class
  • Remote v. Local EJBs
  • EJB Application Development
  • Deploying Enterprise Beans
  • Major Components of Deployed EJBs
  • Summary
 

11. Session Bean

  • Objectives
  • Session Beans
  • Stateless Session Bean
  • Stateful Session Bean
  • Components of Session Beans
  • Home Interfaces
  • Remote interface
  • Local interface
  • The Session Bean Class
  • ejbCreate() Method
  • Business Methods
  • A Simple Stateless Session Bean Example
  • A Simple Stateful Session Bean Example
  • Session Context
  • EJB Context
  • EJB Context
  • Session Bean Lifecycle
  • Lifecycle - Stateless
  • Lifecycle - Stateful
  • Lifecycle Stateful
  • Lifecycle - Stateful
  • Concurrency Issues
  • Invoking Session Beans from client Application
  • Looking Up a Home Object
  • Create an EJB Object
  • Calling business methods
  • IBM RAD for EJB Development
  • Developing a Session Bean using RAD
  • EJB Project in RAD
  • Create an EJB project
  • Examine the EJB project
  • Create a Session Bean
  • Code methods
  • Promote methods to interfaces
  • Deploying EJBs
  • EJB Deployment Descriptor
  • EJB Deployment Descriptor
  • EJB Deployment Descriptor
  • EJB Deployment Descriptor
  • Generating Deployed Code
  • Run on server
  • JNDI Explorer
  • Test the home interface
  • Test the component interface
  • Exporting EJB JAR
  • EJB JAR File Structure
 

12. Entity Bean

  • Objectives
  • Entity Beans
  • Persistence
  • Entity Bean Components
  • Container
  • Container
  • Container
  • Primary Key Class
  • A Primary Key Class Example
  • (Remote) Home Interface
  • (Remote) Home Interface
  • (Remote) Home Interface
  • Local Home Interface
  • Remote Interface
  • Local Interface
  • Entity Bean Class
  • Entity Instance
  • Entity Object Lifecycle
  • Bean Instance Lifecycle
  • Bean Instance Lifecycle
  • Bean Instance Lifecycle
  • Bean Managed Persistence
  • Container Managed Persistence
  • Writing BMP Bean
  • Writing BMP Bean
  • Writing BMP Bean
  • Writing BMP Bean
  • A BMP Bean Example
  • A BMP Bean Example
  • A BMP Bean Example
  • Writing a CMP Bean
  • Indicating Persistent Fields
  • Writing a CMP Bean
  • Writing a CMP Bean
  • Example Bean Class
  • Deployment Descriptor Settings
  • Writing finder methods
  • EJB Query Language
  • EJBQL: Simple examples
  • EJBQL: SELECT clause
  • EJBQL: SELECT clause
  • EJBQL: FROM clause
  • EJBQL: WHERE clause
  • EJBQL: WHERE clause
  • EJBQL: WHERE clause
  • EJBQL: WHERE clause
  • EJBQL: WHERE clause
  • EJBQL: Watch out!
  • Using EJBQL in a CMP bean
  • Business Methods
  • EntityContext
  • Writing CMP Beans
  • Defining and Mapping CMP Fields
  • Developing Entity Beans in RAD
  • Adding a CMP Entity EJB
  • Adding a CMP Entity EJB
  • Adding a CMP Entity EJB
  • EJB Deployment Descriptor
  • Adding a CMP Entity EJB
  • Add an EJBQL query
  • Add an EJBQL query
  • Add an EJBQL query
  • Add an EJBQL query
  • Import Database Schema
  • Creating a database mapping
  • Choosing a backend
  • Choosing a mapping type
  • Specifying the mapping
  • EJB Relationships
  • EJB 2.0 Relationships
  • WebSphere Extensions
 

13. Best Practices

  • Objectives
  • Remove Stateful Session Beans
  • Identify Read-Only Methods
  • Reduce the Transaction Isolation Level where possible
  • Access Entity Beans from Session Bean
  • Reuse EJB Homes
  • Avoid two-phase commit if possible
  • Avoid transactions for non-transactional methods
  • Avoid Stateful Session EJBs
  • CMP Pooling
  • Use Access Beans
  • Types of Access Beans
  • Access Bean Constructor
  • Generating Access Beans
  • Access Bean Examples
  • Do not store large Object Graphs in HttpSession
  • Release HTTP Sessions
  • Use JDBC Connection Pooling
  • Release JDBC Resources
  • Turn off reloading of web applications
  • Make upstream queues progressively smaller
  • Avoid String Concatenations
  • Minimize Synchronization
  • Container managed timer service
  • Annotations Based Development
 

14. J2EE Application Deployment

  • Overview
  • Application Deployment Descriptor
  • Deployment Descriptors
  • Bean Developer Entries
  • Application Assembler Entries
  • Separate Client Side Code (Optional)
  • Generate Deployed Code
  • Export EAR
  • Export EJB JAR
  • EJB JAR File
  • Export Client JAR
  • J2EE Deployment
  • Administrative Console
  • Environment Variables
  • Security
  • Resources
  • Queue Connection Factory
  • Queue Destinations
  • Installing Applications
  • Server Options
  • Starting an Application
  • Summary
 

15. EJB Design Patterns

  • EJB Design Patterns
  • Types of EJB patterns
  • Session Fa ade Pattern
  • Session Fa ade
  • Session Fa ade
  • Session Fa ade
  • Session Facade
  • Session fa ade pattern shortcomings
  • Message Fa ade Pattern
  • Message Fa ade
  • Message Fa ade
  • Message Fa ade
  • Message fa ade pattern shortcomings
  • EJB Command pattern
  • EJB Command
  • EJB Command pattern shortcomings
  • Generic Attribute Access pattern
  • Generic Attribute Access
  • Data Transfer Object (DTO)
  • Data Transfer Rowset
  • Version Number pattern
  • Version Number Pattern
  • Fast Lane Pattern
  • Data Access Command Beans
  • EJBHomeFactory
  • Business Delegate
  • Sequence Blocks
  • Stored Procedures for Autogenerated Keys
  • Summary
 

16. Using RAD for large J2EE projects

  • Overview
  • Designing the Layout of a J2EE Project
  • Project Dependency
  • Designing the Layout of a J2EE Project WAR project
  • Designing the Layout of a J2EE Project EJB project
  • Designing the Layout of a J2EE Project Java project
  • Designing the Layout of a J2EE Project
  • Reference Utility Java Projects
  • Referencing Utility JAR Files
  • An Alternate Approach
  • Class Loading Policy In J2EE
  • How to Configure the Class Loading Policy in the Server
  • Memory Optimization
  • Setting JVM Heap Size
  • Memory Optimization
  • GUI Optimization
  • Build Optimization
  • Overview
  • Close Unnecessary Projects
  • Referencing Remote JAR Files
  • Referencing Remote JAR Files Some Techniques
  • Referencing Remote JAR Files Some Techniques
  • Exporting RAD properties
  • Remote Debugging
  • Updating RAD
  • Automatic Update Manager
  • Summary
 

Appendix A. Message-Driven Beans

  • Objectives
  • The Trouble with RMI/IIOP
  • Messaging to the Rescue
  • Messaging Features
  • Message-Oriented Middleware
  • Messaging Domains
  • Publish/Subscribe
  • Point-to-Point
  • Java Message Service
  • JMS Programming: Overview
  • JMS Programming: Overview
  • The JMS Interfaces
  • JMS Programming: Example
  • JMS Programming: Example
  • JMS Programming: Example
  • Integrating JMS and EJB
  • Message-Driven Beans Are Different From Other EJBs
  • Message-Driven Beans Cannot Talk to Their Clients
  • Message-Driven Beans are Stateless
  • Durable Subscription
  • Message-Driven Bean Interfaces
  • javax.ejb.MessageDrivenBean
  • javax.jms.MessageListener
  • javax.jms.Message
  • Lifecycle
  • Example: Message Counter
  • Class MessageCounter
  • Class MessageCounter
  • Class MessageCounter
  • Working With Messages
  • Processing the Message
  • Deployment Descriptor Entry
  • Binding the Queue or Topic
  • Transactions
  • Security
  • Load Balancing
  • Clustering and Topics
  • Clustering and Queues
  • A Few Tips
  • Poison Messages
  • How the Programmer Can Avoid Poison Messages
  • How the System Administrator Can Avoid Poison Messages
  • Building a Response
  • Potential Problems
  • A Simple Alternative
  • Type Checking and Messages
  • Testing Message-Driven Beans
  • Summary
  • References
 

Appendix B. Custom Tag Libraries

  • Introduction
  • Tag Attributes
  • Tag Body
  • Tag Library Descriptor
  • Tag Library Descriptor Details
  • carPrice.tld
  • The Java Server Page
  • Writing a Simple Tag Handler Class
  • Tag Handler Life Cycle
  • Rendering Content
  • Implementing Empty Body Tag
  • Example: CarPriceHandler
  • CarPriceHandler
  • carPrice.jsp
  • Implementing a Tag With Unprocessed Body
  • Handling Tag Bodies
  • Implementing Body Processing
  • Example: Body Tag Support
  • Implementing an Iteration Tag
  • Nested Tags
  • Summary
 

Appendix C. Java Messaging Service

  • Introduction
  • Messaging Models
  • Components of Point-to-Point Messaging
  • Components of Point-to-Point Messaging (cont.)
  • Implementing a Sender
  • Example Sender Servlet
  • Example Sender Servlet (cont.)
  • Example Sender Stateless Session EJB
  • Example Sender Stateless Session EJB (cont.)
  • Listener Types
  • Listener Design Decisions
  • Implementing a JMS Receiver
  • Implementing a Receiver (cont.)
  • Example: Synchronous Receipt
  • Components of a Pub-Sub Model
  • Components of a Pub-Sub Model (cont.)
  • Example Topic Publisher
  • JMS Programming in RAD
  • Configuring MQ Simulator and Embedded Messaging
  • Configuring WebSphere MQ
  • Configuring WebSphere MQ (cont.)