Chapter 17. Defining the Web Deployment Descriptor

This chapter is for the Web component provider; that is, the person in charge of developing the Web components on the server side.

17.1. Principles

The Web component programmer is responsible for providing the deployment descriptor associated with the developed web components. The Web component provider's responsibilities and the application assembler's responsibilities are to provide an XML deployment descriptor that conforms to the deployment descriptor's XML schema as defined in the Java Servlet Specification Version 2.4. (Refer to $JONAS_ROOT/xml/web-app_2_4.xsd or http://jonas.objectweb.org/current/xml/web-app_2_4.xsd).

To customize the Web components, information not defined in the standard XML deployment descriptor may be needed. For example, the information may include the mapping of the name of referenced resources to its JNDI name. This information can be specified during the deployment phase, within another XML deployment descriptor that is specific to JOnAS. The JOnAS-specific deployment descriptor's XML schema is located in $JONAS_ROOT/xml/jonas-web-app_X_Y.xsd. The file name of the JOnAS-specific XML deployment descriptor must be the file name of the standard XML deployment descriptor prefixed by "jonas-".

The parser gets the specified schema via the classpath (schemas are packaged in the $JONAS_ROOT/lib/common/ow_jonas.jar file).

The standard deployment descriptor (web.xml) should contain structural information that includes the following:

The JOnAS-specific deployment descriptor (jonas-web.xml) may contain information that includes:

<host> element: If the configuration file of the web container contains virtual hosts, the host on which the WAR file is deployed can be set.

<context-root> element: You should specify the name of the context on which the application will be deployed. If it is not specified, the context-root used can be one of the following:

If the context-root is / or empty, the web application is deployed as ROOT context (that is, http://localhost:9000/).

<java2-delegation-model> element: Set the compliance to the Java 2 delegation model.