Wednesday, June 18, 2008

J2EE Fundas

A WAR file is a convenient way to bundle up all pieces of a web application. All servlet containers know how to deploy a WAR file, they expand the bundle, look for the WEB-INF directory, and read the web.xml found there for further deployment instructions.

The EAR file provides the same type of functionality for a full-fledged J2EE application. JBoss expands the EAR, finds the required deployment descriptors, and proceeds from there.

Each component in the EAR is a specific piece of the J2EE puzzle.

Web module : A WAR file containing presentation tier components.
EJB module : An EJB JAR file containing the middle-tier components. (EJBs, MDBs, etc.)
Java module: A regular JAR file containing classes and libraries that are shared across the entire application. An application client JAR and a common JAR are two examples of Java modules.

No comments: