13.07.2015 Views

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

Java™ Application Development on Linux - Dator

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

23.2 Lend Me Your EAR: Enterprise Packaging and Deployment507Example 23.1 C<strong>on</strong>tents of a sample EAR file$ jar -tvf budgetpro.ear0 Wed May 19 05:58:02 CDT 2004 META-INF/110 Wed May 19 05:58:00 CDT 2004 META-INF/MANIFEST.MF295 Wed May 19 05:58:00 CDT 2004 META-INF/applicati<strong>on</strong>.xml11498 Wed May 19 05:58:02 CDT 2004 budgetpro.jar12626 Wed May 19 05:58:02 CDT 2004 budgetpro.war$Table 23.1 Files inside an EAR archiveNamebudgetpro.jarbudgetpro.warMANIFEST.MFapplicati<strong>on</strong>.xmlMETA-INFTypeJARWARtextXMLdirectoryC<strong>on</strong>tentThe EJB-JAR file—the JAR file that c<strong>on</strong>tains our EJB.The Web applicati<strong>on</strong> with servlet and JSP files.A standard JAR manifest; at a minimum, it gives theversi<strong>on</strong> number of the JAR file format—for example,Manifest-Versi<strong>on</strong>: 1.0.The deployment descriptor, an XML descripti<strong>on</strong> ofwhat’s what.A directory with other files.The plain files that appear in the META-INF directory are simple. TheMANIFEST.MF file is like any JAR manifest and can c<strong>on</strong>tain simply the JARversi<strong>on</strong> number:Manifest-Versi<strong>on</strong>: 1.0The applicati<strong>on</strong>.xml file is shown in Example 23.2Two JAR files are menti<strong>on</strong>ed in this XML descripti<strong>on</strong> file. This tells thec<strong>on</strong>tainer that we have two modules, an EJB and a Web applicati<strong>on</strong>. The Webmodule also defines a c<strong>on</strong>text root, which is the porti<strong>on</strong> of the URL pathnamethat is intended to direct requests to this Web applicati<strong>on</strong>. For example, if yourhost is www.bighost.com, then the c<strong>on</strong>text root of /budgetpro means thatthe URL you will use to access the Web applicati<strong>on</strong> in this EAR iswww.bighost.com/budgetpro/ followed by whatever other filename youmight need to append, such as a JSP file—or, if left blank, the defaultindex.html file.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!