The Java Tutorial has been an indispensable resource for many programmers learning the Java programming language. This tutorial hopes to serve the same role for developers encountering the Java 2 Platform, Enterprise Edition (J2EE) for the first time. It follows an example-oriented focus similar to the Java Tutorial.
- Who Should Use This Tutorial
- About the Examples
- Related Information
- How to Print This Tutorial
- Typographical Conventions
Who Should Use This Tutorial
This tutorial is intended for programmers interested in developing and deploying J2EE applications. It covers the main component technologies comprising the J2EE platform and describes how to develop J2EE components and deploy them on the J2EE Software Development Kit (SDK).
This tutorial is not intended for J2EE server or tool vendors. It does not explain how to implement the J2EE architecture, nor does it explain the internals of the J2EE SDK. The J2EE specifications describe the J2EE architecture and can be downloaded fromhttp://java.sun.com/j2ee/docs.html#specs
About the Examples
This tutorial includes many complete, working examples. See Examples for a list of the examples and the chapters where they appear.
Prerequisites for the Examples
To understand the examples, you will need a good knowledge of the Java programming language, SQL, and relational database concepts. The topics in the Java Tutorial listed in Table 1 are particularly relevant:
Table 1 Prerequisite Topics Topic
Downloading the Examples
If you are viewing this online and you want to build and run the examples, you need to download the tutorial bundle fromhttp://java.sun.com/j2ee/download.html#tutorial
Once you have installed the bundle, the example source code is in the
j2eetutorial/examples/srcdirectory, with subdirectories
ejbfor enterprise bean technology examples,
webfor Web technology examples, and
connectorfor connector technology examples. For most of the examples, the bundle also includes J2EE application Enterprise Archive EAR files, which are located in the
How to Build and Run the Examples
This tutorial documents the J2EE SDK version 1.3. To build, deploy, and run the examples you need a copy of the J2EE SDK 1.3 and the Java 2 Platform, Standard Edition (J2SE) SDK 1.3.1 (earlier versions were called JDK). You can download the J2EE SDK fromhttp://java.sun.com/j2ee/download.html#sdk
and the J2SE 1.3.1 from:http://java.sun.com/j2se/1.3/
The examples are distributed with a configuration file for version 1.3 of
anta portable make tool. The
antutility is hosted by the Jakarta project at the Apache Software Foundation. You can download
To build the tutorial examples:
- Download and install the J2SE SDK 1.3.1, J2EE SDK 1.3, and
- The installation instructions for the J2SE SDK, J2EE SDK, and
antexplain how to set the required environment variables. Verify that the environment variables have been set to the values noted in the Table 1.
Table 1 Settings for Environment Variables Environment Variable
The location of the J2SE SDK installation.
The location of the J2EE SDK installation.
The location of the
Should include the
bindirectories of the J2EE SDK, J2SE SDK, and
- Go to the
target. For example, to build all the examples, execute
ant all; to build the Web layer examples, execute
ant web. The build process deposits the output into the directory
This tutorial provides a concise overview of how to use the central component technologies in the J2EE platform. For more information about these technologies, see the Web sites listed in Table 2
Table 2 Information Sources Component Technology
Enterprise JavaBeans (EJB)
JavaServer Pages (JSP)
The J2EE platform includes a wide variety of APIs that this tutorial only briefly touches on. Some of these technologies have their own tutorials, which are listed in Table 3.
Table 3 Other Tutorials API
Java Message Service (JMS)
Java Naming and Directory Interface (JNDI)
Java API for XML Processing (JAXP)
For complete information on these topics, see the Web sites listed in Table 4.
Table 4 Other Web sites API
Once you have become familiar with the J2EE technologies described in this tutorial, you may be interested in guidelines for architecting J2EE applications. The J2EE BluePrints illustrate best practices for developing and deploying J2EE applications. You can obtain the J2EE BluePrints fromhttp://java.sun.com/blueprints
How to Print This Tutorial
To print this tutorial, follow these steps:
- Ensure that Adobe Acrobat Reader is installed on your system.
- Download the PDF version of this book from
- Click the printer icon in Adobe Acrobat Reader.
Table 5 lists the typographical conventions used in this tutorial.
Table 5 Typographical Conventions Font Style
Emphasis, titles, first occurrence of terms
URLs, code examples, file names, command names, programming language keywords
Programming variables, variable file names
Menu selections indicated with the right-arrow character , for example, FirstSecond, should be interpreted as: select the First menu, then choose Second from the First submenu.
The J2EE tutorial team would like to thank the J2EE SDK team for their technical advice.
We are extremely grateful to the many internal and external reviewers who provided feedback on the tutorial. This helped us to improve the presentation, correct errors, and eliminate bugs.
We would also like to thank our manager, Jim Inscore, for his support and steadying influence.
The chapters on Web components use an example and some material that first appeared in the servlet trail of the Java Tutorial. The chapters on custom tags and the Duke's Bank application use a template tag library that first appeared in the J2EE BluePrints.