Document Information

Preface

Part I Introduction

1.  Overview

Java EE 6 Highlights

Java EE Application Model

Distributed Multitiered Applications

Security

Java EE Components

Java EE Clients

Web Clients

Applets

Application Clients

The JavaBeansTM Component Architecture

Java EE Server Communications

Web Components

Business Components

Enterprise Information System Tier

Java EE Containers

Container Services

Container Types

Web Services Support

XML

SOAP Transport Protocol

WSDL Standard Format

Java EE Application Assembly and Deployment

Development Roles

Java EE Product Provider

Tool Provider

Application Component Provider

Enterprise Bean Developer

Web Component Developer

Application Client Developer

Application Assembler

Application Deployer and Administrator

Java EE 6 APIs

Enterprise JavaBeans Technology

Java Servlet Technology

JavaServer Faces Technology

JavaServer PagesTM Technology

JavaServer Pages Standard Tag Library

Java Persistence API

Java Transaction API

Java API for RESTful Web Services (JAX-RS)

Java Message Service API

Java EE Connector Architecture

JavaMailTM API

Java Authorization Service Provider Contract for Containers (Java ACC)

Java Authentication Service Provider Interface for Containers (JASPIC)

Java API for XML Registries

Simplified Systems Integration

Java EE 6 APIs Included in the Java Platform, Standard Edition 6.0 (Java SE 6)

Java Database Connectivity API

Java Naming and Directory InterfaceTM

JavaBeans Activation Framework

Java API for XML Processing

Java Architecture for XML Binding (JAXB)

SOAP with Attachments API for Java

Java API for XML Web Services (JAX-WS)

Java Authentication and Authorization Service

Sun GlassFish Enterprise Server v3

Tools

2.  Using the Tutorial Examples

Part II The Web Tier

3.  Getting Started with Web Applications

4.  JavaServerTM Faces Technology

5.  Introduction to Facelets

6.  Unified Expression Language

7.  Using JavaServerTM Faces Technology in Web Pages

8.  Using Converters, Listeners and Validators

9.  Developing With JavaServerTM Faces Technology

10.  Java Servlet Technology

Part III Web Services

11.  Introduction to Web Services

12.  Building Web Services with JAX-WS

13.  Building RESTful Web Services with JAX-RS and Jersey

Part IV Enterprise Beans

14.  Enterprise Beans

15.  Getting Started with Enterprise Beans

16.  Running the Enterprise Bean Examples

Part V Contexts and Dependency Injection for the JavaTM EE Platform

17.  Introduction to Contexts and Dependency Injection for the JavaTM EE Platform

18.  Running the Basic Contexts and Dependency Injection Examples

Part VI Persistence

19.  Introduction to the Java Persistence API

20.  Running the Persistence Examples

21.  The Java Persistence Query Language

22.  Creating Queries Using the Criteria API

Part VII Security

23.  Introduction to Security in the Java EE Platform

24.  Getting Started Securing Enterprise Applications

25.  Getting Started Securing Web Applications

Part VIII JavaTM EE Supporting Technologies

26.  Introduction to JavaTM EE Supporting Technologies

27.  Transactions

28.  Resource Connections

Index

 

Packaging Applications

A Java EE application is delivered in either a Java Archive (JAR) file, a Web Archive (WAR) file, or an Enterprise Archive (EAR) file. A WAR or EAR file is a standard JAR (.jar) file with a .war or .ear extension. Using JAR, WAR, and EAR files and modules makes it possible to assemble a number of different Java EE applications using some of the same components. No extra coding is needed; it is only a matter of assembling (or packaging) various Java EE modules into Java EE JAR, WAR, or EAR files.

An EAR file (see Figure 1-6) contains Java EE modules and, optionally, deployment descriptors. A deployment descriptor is an XML document with an .xml extension that describes the deployment settings of an application, a module, or a component. Because deployment descriptor information is declarative, it can be changed without the need to modify the source code. At runtime, the Java EE server reads the deployment descriptor and acts upon the application, module, or component accordingly.

Figure 1-6 EAR File Structure
Diagram of EAR file structure. META-INF and web, application client, EJB, and resource adapter modules are under the assembly root.

There are two types of deployment descriptors: Java EE and runtime. A Java EE deployment descriptor is defined by a Java EE specification and can be used to configure deployment settings on any Java EE-compliant implementation. A runtime deployment descriptor is used to configure Java EE implementation-specific parameters. For example, the Sun GlassFish Enterprise Server runtime deployment descriptor contains information such as the context root of a web application, and Enterprise Server implementation-specific parameters, such as caching directives. The Enterprise Server runtime deployment descriptors are named sun-moduleType.xml and are located in the same META-INF directory as the Java EE deployment descriptor.

A Java EE module consists of one or more Java EE components for the same container type and, optionally, one component deployment descriptor of that type. An enterprise bean module deployment descriptor, for example, declares transaction attributes and security authorizations for an enterprise bean. A Java EE module can be deployed as a stand-alone module.

The four types of Java EE modules are as follows:

  • EJB modules, which contain class files for enterprise beans and an EJB deployment descriptor. EJB modules are packaged as JAR files with a .jar extension.

  • Web modules, which contain servlet class files, web files, supporting class files, GIF and HTML files, and a web application deployment descriptor. Web modules are packaged as JAR files with a .war (Web ARchive) extension.

  • Application client modules, which contain class files and an application client deployment descriptor. Application client modules are packaged as JAR files with a .jar extension.

  • Resource adapter modules, which contain all Java interfaces, classes, native libraries, and other documentation, along with the resource adapter deployment descriptor. Together, these implement the Connector architecture (see Java EE Connector Architecture) for a particular EIS. Resource adapter modules are packaged as JAR files with an .rar (resource adapter archive) extension.