The J2EE™ Tutorial Second Edition

Book description

The J2EE™ Tutorial, Second Edition, is the complete guide to all major components of the Java 2 Platform, Enterprise Edition (J2EE) version 1.4. Written by members of the J2EE platform team at Sun Microsystems, this is the task-oriented and example-driven book that will have new and intermediate Java programmers building J2EE applications right away.

The first chapters introduce the J2EE 1.4 platform architecture and APIs, the Sun Java System Application Server Platform Edition 8, and the basics of working with XML and Web applications. The greater part of the book is devoted to describing and demonstrating the Java XML, Web-tier, and Enterprise JavaBeans technologies and platform services. Extensive examples and case studies show you how to put these technologies to work in the real world.

The technologies and services detailed include:

  • Java API for XML Processing (JAXP)

  • Java API for XML-Based RPC (JAX-RPC)

  • SOAP with Attachments API for Java (SAAJ)

  • Java API for XML Registries (JAXR)

  • Java Servlet

  • JavaServer Pages (JSP)

  • JSP Standard Tag Library (JSTL)

  • JavaServer Faces

  • Internationalization and localization

  • Enterprise JavaBeans (EJB)

  • Transactions

  • Resource connections

  • Security

  • Java Message Service API (JMS API)

  • The J2EE™ Tutorial, Second Edition, will give you a head start in developing and deploying J2EE applications.

    The accompanying CD-ROM includes the tutorial examples (binary and source code) and the J2EE Software Development Kit, Enterprise Edition 1.4 (J2EE 1.4 SDK), which contains the Sun Java System Application Server Platform Edition 8, Java 2 Software Development Kit (J2SE SDK), and BluePrints sample applications.

    Table of contents

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

    Product information

    • Title: The J2EE™ Tutorial Second Edition
    • Author(s): Stephanie Bodoff, Eric Armstrong, Jennifer Ball, Debbie Bode Carson, Ian Evans, Dale Green, Kim Haase, Eric Jendrock
    • Release date: June 2004
    • Publisher(s): Addison-Wesley Professional
    • ISBN: 9780321245755