Document Information

Preface

Part I Introduction

1.  Overview

2.  Using the Tutorial Examples

Starting and Stopping the Application Server

Starting the Admin Console

Starting and Stopping the Java DB Database Server

Building the Examples

Building the Examples Using NetBeans IDE

Building the Examples on the Command-Line Using Ant

Tutorial Example Directory Structure

Debugging Java EE Applications

Using the Server Log

Using a Debugger

Part II The Web Tier

3.  Getting Started with Web Applications

4.  Java Servlet Technology

5.  JavaServer Pages Technology

6.  JavaServer Pages Documents

7.  JavaServer Pages Standard Tag Library

8.  Custom Tags in JSP Pages

9.  Scripting in JSP Pages

10.  JavaServer Faces Technology

11.  Using JavaServer Faces Technology in JSP Pages

12.  Developing with JavaServer Faces Technology

13.  Creating Custom UI Components

14.  Configuring JavaServer Faces Applications

15.  Internationalizing and Localizing Web Applications

Part III Web Services

16.  Building Web Services with JAX-WS

17.  Binding between XML Schema and Java Classes

18.  Streaming API for XML

19.  SOAP with Attachments API for Java

Part IV Enterprise Beans

20.  Enterprise Beans

21.  Getting Started with Enterprise Beans

22.  Session Bean Examples

23.  A Message-Driven Bean Example

Part V Persistence

24.  Introduction to the Java Persistence API

25.  Persistence in the Web Tier

26.  Persistence in the EJB Tier

27.  The Java Persistence Query Language

Part VI Services

28.  Introduction to Security in the Java EE Platform

29.  Securing Java EE Applications

30.  Securing Web Applications

31.  The Java Message Service API

32.  Java EE Examples Using the JMS API

33.  Transactions

34.  Resource Connections

35.  Connector Architecture

Part VII Case Studies

36.  The Coffee Break Application

37.  The Duke's Bank Application

Part VIII Appendixes

A.  Java Encoding Schemes

B.  Preparation for Java EE Certification Exams

C.  About the Authors

Index

 

Required Software

The following software is required to run the examples.

Tutorial Bundle

The tutorial example source is contained in the tutorial bundle. To obtain the tutorial bundle, go to http://java.sun.com/javaee/5/docs/tutorial/information/download.html. The tutorial bundle is a zip file that you can unzip in a location of your choice.

After you have installed the tutorial bundle, the example source code is in the tut-install/javaeetutorial5/examples/ directory, where tut-install is the directory where you installed the tutorial. The examples directory contains subdirectories for each of the technologies discussed in the tutorial.

Java Platform, Standard Edition

To build, deploy, and run the examples, you need a copy of Java Platform, Standard Edition 5.0 or Java Platform, Standard Edition 6.0 (J2SE 5.0 or JDK 6). You can download the J2SE 5.0 software from http://java.sun.com/javase/downloads/index_jdk5.jsp. You can download the JDK 6 software from http://java.sun.com/javase/downloads/.

Download the current JDK update that does not include any other software (such as NetBeans or Java EE).

Sun Java System Application Server 9.1

Sun Java System Application Server 9.1 is targeted as the build and runtime environment for the tutorial examples. To build, deploy, and run the examples, you need a copy of the Application Server and, optionally, NetBeans IDE. You can download the Application Server from http://java.sun.com/javaee/downloads/.

Scroll down to the section entitled Download the Components Independently and click the Download link next to Sun Java System Application Server 9.1 (based on GlassFish V2).


Note - You can also run the tutorial examples using Sun Java System Application Server 9.0, or using GlassFish V2.


Application Server Installation Tips

During the installation of the Application Server:

  • Accept the default admin user name, and specify a password. The default user name is admin. Remember the password you specify (for example, adminadmin). You will need this user name and password.

  • Select the Don't Prompt for Admin User Name and Password radio button.

  • Note the HTTP port at which the server is installed. This tutorial assumes that you are accepting the default port of 8080. If 8080 is in use during installation and the installer chooses another port or if you decide to change it yourself, you will need to update the common build properties file (described in the next section) and the configuration files for some of the tutorial examples to reflect the correct port.

This tutorial refers to the directory where you install the Application Server as as-install. For example, the default installation directory on Microsoft Windows is C:\Sun\AppServer, so as-install is C:\Sun\AppServer.

After you install the Application Server, add the following directories to your PATH to avoid having to specify the full path when you use commands:

as-install/bin
as-install/lib/ant/bin

NetBeans IDE

The NetBeans integrated development environment (IDE) is a free, open-source IDE for developing Java applications, including enterprise applications. NetBeans IDE supports the Java EE 5 platform. You can build, package, deploy, and run the tutorial examples from within NetBeans IDE.

You can download NetBeans IDE from http://www.netbeans.org/.

The current version of NetBeans IDE is 5.5.1. Along with the IDE, you will need to install Hotfixes needed for Java EE components.

To install the NetBeans IDE 5.5.1 Hotfixes, perform these steps:

  1. Download and install NetBeans IDE 5.5.1 FCS, then start the IDE.

  2. In NetBeans IDE, Select Tools → Update Center.

    The Update Center Wizard opens.

  3. Select the Check the Web for Available Updates and New Modules radio button.

  4. In the Select Update Center(s) to connect panel, select Netbeans Hotfix Update Center.

  5. If necessary, click the Proxy Configuration button and configure the proxy settings to allow you to connect to the Update Center.

  6. Click Next to connect to the Update Center server.

  7. In the Available Updates and New Modules panel, select NetBeans Hotfix Update Center and click Add.

    Two modules appear in the Include in Install panel.

  8. Click Next.

  9. Read and accept the License Agreement.

    The modules you selected are downloaded and the digital signatures are checked and verified.

  10. Click Next.

  11. Click Finish.

  12. In the Restart the IDE dialog, click OK.

    The IDE must be restarted to install the modules.

Apache Ant

Ant is a Java technology-based build tool developed by the Apache Software Foundation (http://ant.apache.org/), and is used to build, package, and deploy the tutorial examples. Ant is included with the Application Server. To use the ant command, add as-install/lib/ant/bin to your PATH environment variable.