Java Reference
In-Depth Information
Example 23.1 Contents of a sample EAR file
$ jar -tvf budgetpro.ear
0 Wed May 19 05:58:02 CDT 2004 META-INF/
110 Wed May 19 05:58:00 CDT 2004 META-INF/MANIFEST.MF
295 Wed May 19 05:58:00 CDT 2004 META-INF/application.xml
11498 Wed May 19 05:58:02 CDT 2004 budgetpro.jar
12626 Wed May 19 05:58:02 CDT 2004 budgetpro.war
$
Table 23.1 Files inside an EAR archive
Name
Type
Content
JAR
The EJB-JAR file—the JAR file that contains our EJB.
budgetpro.jar
WAR
The Web application with servlet and JSP files.
budgetpro.war
text
A standard JAR manifest; at a minimum, it gives the
version number of the JAR file format—for example,
Manifest-Version: 1.0 .
MANIFEST.MF
XML
The deployment descriptor , an XML description of
what's what.
application.xml
directory
A directory with other files.
META-INF
The plain files that appear in the META-INF directory are simple. The
MANIFEST.MF file is like any JAR manifest and can contain simply the JAR
version number:
Manifest-Version: 1.0
The application.xml file is shown in Example 23.2
Two JAR files are mentioned in this XML description file. This tells the
container that we have two modules, an EJB and a Web application. The Web
module also defines a context root, which is the portion of the URL pathname
that is intended to direct requests to this Web application. For example, if your
host is www.bighost.com , then the context root of /budgetpro means that
the URL you will use to access the Web application in this EAR is
www.bighost.com/budgetpro/ followed by whatever other filename you
might need to append, such as a JSP file—or, if left blank, the default
index.html file.
Search WWH ::




Custom Search