Home > Store

J2EE  Tutorial, The, 2nd Edition

Register your product to gain access to bonus material or receive a coupon.

J2EE Tutorial, The, 2nd Edition

Premium Website

  • Sorry, this book is no longer in print.
Not for Sale



Discover the ins-and-outs of the new J2EE 1.4 platform and learn how to build J2EE applications with the latest edition of this tutorial.

° Proven tutorial retains its popular approach to show the reader how to build applications for the J2EE 1.4 platform

° Part of The Java Series from Addison-Wesley; late June product launch at JavaOne in San Francisco

° Thorough coverage of Java servlets, JSP, EJB, security, and much more!


  • Copyright 2004
  • Edition: 2nd
  • Premium Website
  • ISBN-10: 0-321-24575-X
  • ISBN-13: 978-0-321-24575-5

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.


Related Article

Tips for J2EE Development

Sample Content

Online Sample Chapter

Using JavaServer Faces Technology in JSP Pages

Downloadable Sample Chapter

Download the Sample Chapter related to this title.

Table of Contents


About This Tutorial.

1. Overview.

Distributed Multitiered Applications.2

J2EE Containers.

Web Services Support.

Packaging Applications.

Development Roles.

J2EE 1.4 Platform APIs.

Sun Java System Application Server Platform Edition 8.

2. Understanding XML.

Introduction to XML.

Generating XML Data.

Designing an XML Data Structure.


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.

4. Java API for XML Processing.


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?

5. Simple API for XML.

When to Use SAX.

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.

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.

7. Extensible Stylesheet Language Transformations.

Introducing XSL, XSLT and XPath.

How XPath Works.

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.

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.

9. SOAP with Attachments API for Java.

Overview of SAAJ.


Code Examples.

Further Information.

10. Java API for XML Registries.

Implementing a JAXR Client .

Running the Client Examples.

Using JAXR Clients in J2EE Applications.

Further Information.

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.

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.

13. JavaServer Pages Documents.

The Example JSP Document.

Creating a JSP Document.

Identifying the JSP Document to the Container.

14. JavaServer Pages Standard Tag Library.

The Example JSP Pages.

Using JSTL.

Core Tag Library.

XML Tag Library.

Internationalization Tag Library.

SQL Tag Library.


Further Information.

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.

16. Scripting in JSP Pages.

The Example JSP Pages.

Using Scripting.

Disabling Scripting.




Programming Tags That Accept Scripting Elements.

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.

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.

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.

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.

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.

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.

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.

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.

25. Session Bean Examples.

The CartBean Example.

A Web Service Example: HelloServiceBean.

Other Enterprise Bean Features.

Using the Timer Service.

Handling Exceptions.

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.

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.

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.

29. Enterprise JavaBeans Query Language.


Simplified Syntax.

Example Queries.

Full Syntax.

EJB QL Restrictions.

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.

31. Resource Connections.

JNDI Naming.

DataSource Objects and Connection Pools.

Database Connections.

Mail Session Connections.

URL Connections.

Further Information.

32. Security.


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.

34. The Java Message Service API.


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.

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.

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.

36. The Duke's Bank Application.

Enterprise Beans.

Application Client.


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 .


Appendix C: HTTP Overview.

HTTP Requests.

HTTP Responses.

Appendix D: J2EE Connector Architecture.

About Resource Adapters.

Resource Adapter Contracts.

Common Client Interface.

Further Information.


About the Authors.



Download the Foreword related to this title.


Download the Index file related to this title.


Submit Errata

More Information

Unlimited one-month access with your purchase
Free Safari Membership