Web Authoring
  Home arrow Web Authoring arrow Page 2 - Building and Deploying an EAR
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WEB AUTHORING

Building and Deploying an EAR
By: O'Reilly Media
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 2
    2007-07-05

    Table of Contents:
  • Building and Deploying an EAR
  • Application.xml
  • Common JAR
  • Exploring the New Directory Structure

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Building and Deploying an EAR - Application.xml


    (Page 2 of 4 )

    Just as a WAR file contains a web.xml deployment descriptor, an EAR file contains a file named application.xml. It is essentially a packing list, telling the J2EE server exactly what files the EAR contains and where you can find the files relative to the root of the EAR. The EAR file’s META-INF directory stores application.xml.

    Example 3-1 shows the JAW Motors application.xml file.

    Example 3-1.  application.xml

    <?xml version="1.0" encoding="UTF-8"?> <application xmlns=http://java.sun.com/xml/ns/j2ee 
            xmlns:xsi="http://www.w3.org/ 2001/XMLSchema-instance"  
            xsi:schemaLocation="http:// java.sun.com/xml/ns/j2ee
               
    http://java.sun.com/xml/ns/j2ee/ application_1_4.xsd"
            version="1.4">
     <display-name>JBossAtWorkEAR</display-name>

     <module>
        
    <web>
             <web-uri>webapp.war</web-uri>
             <context-root>jaw</context-root>
         </web>
      </module>

      <module>
         <java>common.jar</java>
      </module>

    </application>

    The elements in application.xml should be pretty self-explanatory. We are telling the application server the name of each JAR and what function it serves.

    Notice that Web modules allow you to specify one other value—the<context-root>. Recall from the previous chapter that the context root is your web site’s URL. If you deploy a simple WAR file, the name of the WAR will be used as the URL. When your WAR file is deployed inside an EAR, this element allows you to override the physical name of the WAR and use whatever URL you’d like.

    Although not shown in this example,<security-role>is another important element in application.xml.The<security-role>element describes (what else?) the security roles used throughout a J2EE application for both web and EJB components. Defining security roles in application.xml provides a single place to set up J2EE declarative security without duplicating it in web.xml and ejb-jar.xml. The Security chapter describes<security-role>in greater detail.

    More Web Authoring Articles
    More By O'Reilly Media


       · This article is an excerpt from the book "JBoss at Work: A Practical Guide,"...
     

    Buy this book now. This article is excerpted from chapter 3 of the book JBoss at Work: A Practical Guide, written by Tom Marrs and Scott Davis (O'Reilly; ISBN: 0596007345). Check it out today at your favorite bookstore. Buy this book now.

    WEB AUTHORING ARTICLES

    - Yahoo Pipes: Worth a Look
    - Completing an EAR
    - Building and Deploying an EAR
    - New Nuke Security Sentinel: Worth Taking a C...
    - Administering Your CMS-Based Web Site
    - What You Need to Know Before Using a CMS
    - Introducing the Google Maps API
    - An Overview of the Yahoo User Interface Libr...
    - Basic configuration of osCommerce, concluded
    - Basic configuration of osCommerce, continued
    - Basic configuration of osCommerce
    - Deploying your Site with PHPEclipse, continu...
    - Deploying your Site with phpEclipse
    - Macromedia Captivate Review
    - Macromedia and Adobe Planning to Tie the Knot







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek