The J2EETM Tutorial
Home
TOC
PREV TOC NEXT Search
Feedback

Packaging

J2EE components are packaged separately and bundled into a J2EE application for deployment. Each component, its related files such as GIF and HTML files or server-side utility classes, and a deployment descriptor (DD), are assembled into a module and added to the J2EE application. A J2EE application is composed of one or more enterprise bean, web, or application client component modules. The final enterprise solution can use one J2EE application or be made up of two or more J2EE applications depending on design requirements

A J2EE application and each of its modules has its own deployment descriptor. A deployment descriptor is an Extensible Markup Language (XML) text-based file with an .xml extension that describes a component's deployment settings. An enterprise bean module deployment descriptor, for example, declares transaction attributes and security authorizations for an enterprise bean. Because deployment descriptor information is declarative, it can be changed without modifying the bean source code. At run time, the J2EE server reads the deployment descriptor and acts upon the component accordingly.

A J2EE application with all of its modules is delivered in an Enterprise ARchive (EAR) file. An EAR file is a standard JAR file with an .ear extension. In the GUI version of the J2EE SDK application deployment tool, you create an EAR file first and add JAR and WAR files to the EAR. If you use the command line packager tools, however, you create the Java ARchive (JARs) and Web ARchive (WAR) files first and create the EAR. The J2EE SDK tools are described in Tools.

Using modules and EAR files makes it possible to assemble a number of different J2EE applications using some of the same components. No extra coding is needed; it is just a matter of assembling various J2EE modules into J2EE EAR files.

Home
TOC
PREV TOC NEXT Search
Feedback