Document Information


Part I Introduction

1.  Overview

2.  Using the Tutorial Examples

Required Software

Tutorial Bundle

To Obtain the Tutorial Bundle

Java Platform, Standard Edition

Sun Java System Application Server 9.1

Application Server Installation Tips

NetBeans IDE

Apache Ant

Starting and Stopping the Application Server

Starting the Admin Console

Starting and Stopping the Java DB Database Server

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.  About the Authors



Building the Examples

The tutorial examples are distributed with a configuration file for either NetBeans IDE or Ant. Directions for building the examples are provided in each chapter. Either NetBeans IDE or Ant may be used to build, package, deploy, and run the examples.

Building the Examples Using NetBeans IDE

To run the tutorial examples in NetBeans IDE, you must register your Application Server installation as a NetBeans Server Instance. Follow these instructions to register the Application Server in NetBeans IDE.

  1. Select Tools→Server Manager to open the Server Manager dialog.

  2. Click Add Server.

  3. Under Server, select Sun Java System Application Server and click Next.

  4. Under Platform Location, enter the location of your Application Server installation.

  5. Select Register Local Default Domain and click Next.

  6. Under Admin Username and Admin Password, enter the admin name and password created when you installed the Application Server.

  7. Click Finish.

Building the Examples on the Command-Line Using Ant

Build properties common to all the examples are specified in the file in the tut-install/javaeetutorial5/examples/bp-project/ directory. You must create this file before you can run the examples. Copy the file to and edit it to reflect your environment. The tutorial examples use the Java BluePrints build system and application layout structure.

To run the Ant scripts, you must set common build properties in the file tut-install/javaeetutorial5/examples/bp-project/ as follows:

  • Set the javaee.home property to the location of your Application Server installation. The build process uses the javaee.home property to include the libraries in as-install/lib/ in the classpath. All examples that run on the Application Server include the Java EE library archive, as-install/lib/javaee.jar. in the build classpath. Some examples use additional libraries in as-install/lib/; the required libraries are enumerated in the individual technology chapters.

    Note - On Windows, you must escape any backslashes in the javaee.home property with another backslash or use forward slashes as a path separator. So, if your Application Server installation is C:\Sun\AppServer, you must set javaee.home to javaee.home = C:\\Sun\\AppServer or javaee.home=C:/Sun/AppServer.

  • Set the javaee.tutorial.home property to the location of your tutorial. This property is used for Ant deployment and undeployment.

    For example, on UNIX:


    On Windows:


    Do not install the tutorial to a location with spaces in the path.

  • If you did not accept the default values for the admin user and password, set the admin.user property to the value you specified when you installed the Application Server, and set the admin user’s password in the admin-password.txt file in the tut-install/javaeetutorial5/examples/common/ directory to the value you specified when you installed the Application Server.

  • If you did not use port 8080, set the domain.resources.port property to the value specified when you installed the Application Server.