Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The geronimo-web.xml deployment plan is defined by the geronimo-web-2.0.1.xsd schema located in the <geronimo_home>/schema/ subdirectory of the main Geronimo installation directory. The geronimo-web-2.0.1.xsd schema itself is shown below:

...

briefly described here:

http://geronimo.apache.org/schemas-2.1/docs/

...

geronimo-web-2.0.1.xsd.htmlImage Added

Top-level elements

The top-most element in the geronimo-web-2.0.1.xsd is <web-app> element. The top-level elements of the <web-app> element are described below:

<sys:environment>

The <sys:environment> elements use the Geronimo deployment namespace described at http://geronimo.apache.org/schemas-2.1/docs/geronimo-module-1.2.xsd.htmlImage Added. The <sys:environment> contains the following elements:

  • The <moduleId> element is used to provid the configuration name for the web application as deployed in the Geronimo server. It contains elements for the groupId, artifactId, version and module type. Module IDs are normally printed with slashes between the four components, such as GroupID/ArtifactID/Version/Type.
  • The <dependencies> element is used to provide the configurations and third party libraries on which the web module is dependent upon. These configurations and libraries are made available to the web module via the Geronimo classloader hierarchy.
  • The <hidden-classes> element can be used to specify classes that are hidden from parent class loaders
  • The <non-overridable-classes> element can be used to specify classes that are only loaded from parent class loaders
  • The <inverse-classloading> element can be used to specify that standard classloader delegation should be reversed
  • The <suppress-default-environment> element can be used to suppress inheritance of environment by module

An example geronimo-web.xml file is shown below using the <sys:environment> elements:

Code Block
xml
xml
borderStylesolid
title<sys:environment> example

<web-app xmlns

<?xml version="1.0" encoding="UTF-8"?>
<!--

    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->

<!-- $Rev: 636723 $ $Date: 2008-03-13 07:36:06 -0400 (Thu, 13 Mar 2008) $ -->

<xs:schema
    xmlns:web="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1"
    targetNamespace="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1"
         xmlns:namingsys="http://geronimo.apache.org/xml/ns/namingdeployment-1.2">

    xmlns:app="http://geronimo.apache.org/xml/ns/j2ee/application-2.0"<sys:environment>

    xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2"
    xmlns:ee="http://java.sun.com/xml/ns/persistence"
<sys:moduleId>
         xmlns:xs="http://www.w3.org/2001/XMLSchema"
   <sys:groupId>default</sys:groupId>
     elementFormDefault="qualified"
    attributeFormDefault="unqualified"
   <sys:artifactId>geronimo-web-6</sys:artifactId>
       version="1.0">

    <xs:import namespace="http://geronimo.apache.org/xml/ns/naming-1.2" schemaLocation="geronimo-naming-1.2.xsd"/>
    <xs:import namespace="http://geronimo.apache.org/xml/ns/j2ee/application-2.0" schemaLocation="geronimo-application-2.0.xsd"/>
    <xs:import namespace="http://geronimo.apache.org/xml/ns/deployment-1.2" schemaLocation="geronimo-module-1.2.xsd"/>
    <xs:import namespace="http://java.sun.com/xml/ns/persistence" schemaLocation="http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"/>

    <xs:element name="web-app" type="web:web-appType"/>
    <xs:annotation>
 <sys:version>1.0</sys:version>
            <sys:type>car</sys:type>
        </sys:moduleId>

        <sys:dependencies>
            <sys:dependency>
                <sys:groupId>org.apache.geronimo.configs</sys:groupId>
                <sys:artifactId>tomcat6</sys:artifactId>
                <sys:version>2.2-SNAPSHOT</sys:version>
            <xs:documentation>
    <sys:type>car</sys:type>
        The web-app element is the root of the deployment descriptor for a Geronimo web    </sys:dependency>

            <sys:dependency>
            application. Note that the sub-elements of this element should be as in the given order because it is 
     <sys:groupId>default</sys:groupId>
                <sys:artifactId>geronimo-web-5</sys:artifactId>
          defined    as a sequence.<sys:version>1.0</sys:version>
        </xs:documentation>
        <<sys:type>car</xssys:annotation>type>
    <xs:annotation>
        <xs:documentation></sys:dependency>

            This<sys:dependency>
 group keeps the usage of the contained JNDI environment
       <sys:groupId>default</sys:groupId>
     reference elements consistent across J2EE deployment descriptors.
        </xs:documentation>
<sys:artifactId>geronimo-web-4</sys:artifactId>
     </xs:annotation>

    <xs:complexType name="web-appType">
      <sys:version>1.0</sys:version>
  <xs:sequence>
              <xs:element ref="sys:environment" minOccurs="0"><sys:type>car</sys:type>
                <xs:annotation></sys:dependency>

             <sys:dependency>
       <xs:documentation>         <sys:groupId>default</sys:groupId>
                <sys:artifactId>geronimo-web-2</sys:artifactId>
                <sys:version>1.0</sys:version>
        This  is the first part of the URL used to access the web application.
 <sys:type>car</sys:type>
            </sys:dependency>
        </sys:dependencies>

        <sys:hidden-classes/>
  For example context-root of "Sample-App" will have URL of 
 <sys:non-overridable-classes/>
        <sys:inverse-classloading/>
                   http://host:port/Sample-App" and a context-root of "/" would be make this the default web application to the server.

                        If the web application is packaged as an EAR that can use application context
                        in the "application.xml". This element is necessary unless you want context root to default to the WAR 
                        name.
                    </xs:documentation>
                </xs:annotation>
            </xs:element>

            <xs:element name="context-root" type="xs:string" minOccurs="0"/>
            <xs:element name="work-dir" type="xs:string" minOccurs="0">
                <xs:annotation>
                    <xs:documentation>
                        This is the work directory that will be used by this application.
                        For Jetty this will be relative to jetty home which is var/jetty
                        by default.
                        For Tomcat this will be relative to "catalina.home".
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <!--<xs:element name="context-priority-classloader" type="xs:boolean" minOccurs="0"/>-->
            <xs:element ref="naming:web-container" minOccurs="0"/>
            <xs:element name="container-config" type="web:container-configType" minOccurs="0">
                <xs:annotation>
                    <xs:documentation>
                        Geronimo supports both Jetty and Tomcat web containers. This element is
                        for a web application needs to take container specific settings. It can hold either a Tomcat element or a Jetty element or both.
                    </xs:documentation>
                </xs:annotation>
            </xs:element>

            <xs:group ref="naming:jndiEnvironmentRefsGroup"/>
            <xs:element ref="naming:message-destination" minOccurs="0" maxOccurs="unbounded"/>

            <xs:sequence minOccurs="0">
                <xs:element name="security-realm-name" type="xs:string"/>
                <xs:element ref="app:security" minOccurs="0"/>
            </xs:sequence>

            <xs:choice minOccurs="0" maxOccurs="unbounded">
                <xs:element ref="sys:service" minOccurs="0" maxOccurs="unbounded">
                    <xs:annotation>
                        <xs:documentation>
                            Reference to abstract service element defined in imported
                            "geronimo-module-1.2.xsd"
                        </xs:documentation>
                    </xs:annotation>
                </xs:element>
                <xs:element ref="ee:persistence"/>
            </xs:choice>
            

        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="container-configType">
        <xs:sequence>
            <xs:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>

</xs:schema>

Top-level elements

The top-level element in the geronimo-web-2.0.1.xsd is <web-app> element. A graphical view of the children of this top-level element in geronimo-web-2.0.1.xsd is shown below:

http://geronimo.apache.org/schemas-2.1/docs/geronimo-web-2.0.1.xsd.htmlImage Removed

Image Removed

The children of the <web-app> top-level element are described below:

<sys:environment>

The <sys:environment> element uses the Geronimo deployment namespace
These elements provide the moduleid configuration and the dependencies. The moduleId elements provide the configuration name for the web module. So, when the web module is deployed, it is given the configuration name samples/samples/2.5/jar. The dependencies elements provide the configurations and third party libraries on which the web module is dependent on. These configurations and libraries will be available to the web module via a classloader hierarchy. In this case, the web module is dependent on samples/EmployeeDatasource/2.5/rar which is the configuration of the deployed Datasource that connects to a back end DB2 database. The Datasource deploys a database connection pool (javax.sql.Datasource) with name jdbc/EmployeeDatasource.

<context-root>

<work-dir>

<naming:web-container>

<container-config>

<naming:abstract-naming-entry>

<ejb-ref>

<ejb-local-ref>

<service-ref>

<resource-ref>

<resource-env-ref>

<naming:message-destination>

<security-realm-name>

<app:security>

<sys:service>

<sys:suppress-default-environment/>

    </sys:environment> 
   
</web-app>

<context-root>

The <context-root> uses the default namespaced described at

The XML elements used to provide the web context root of the web applications.

Specifies a context path to the deployed application. This context path appears in the URL used to address the application on a Geronimo server. By default, the application deploy module base name (without the extension) is used. Typically, this element is used in a WAR deployment.

<work-dir>

The <work-dir> uses the default namespaced described at

'This is the work directory that will be used by this application. For Jetty this will be relative to jetty home which is var/jetty by default. For Tomcat this will be relative to \"catalina.home\".

<naming:web-container>

The <work-dir> uses the default namespaced described at

<container-config>

The <context-root> uses the default namespaced described at

If you use the generic (geronimo-web-2.0.xsd) web application configuration, you can use these elements in the container-config element to configure Tomcat-specific behavior.

'Geronimo supports both Jetty and Tomcat web containers. This element is for a web application needs to take container specific settings. It can hold either a Tomcat element or a Jetty element or both.'

This element is reserved for the configuration of elements specific to the underlying Web-tier container. In Geronimo's case, this is either Jetty or Tomcat.

<naming:abstract-naming-entry>

<ejb-ref>

The <context-root> uses the default namespaced described at
'The element ejb-ref is used to map EJB references to EJB\'s in other applications using remote home and remote interface. The application which contains the EJB being referenced should either be in same EAR or should be included in dependency list of this application. Also note as the EJB\'s referenced are in a different JVM all the Client interfaces should also be included in current application.'

<ejb-local-ref>

The <context-root> uses the default namespaced described at
'The element ejb-local-ref is used to map EJB references to EJB\'s in other applications using local home and local interface. The application which contains the EJB being referenced should either be in same EAR or should be included in dependency list of this application. Also note as the EJB\'s referenced are in a different JVM all the Client interfaces should also be included in current application.'

<service-ref>

The <context-root> uses the default namespaced described at

'The element service-ref is used to map service references to service\'s in other applications. The application which contains the EJB being referenced should either be in same EAR or should be included in dependency list of this application.'

<resource-ref>

The <context-root> uses the default namespaced described at
'The element resource-ref is used to map resource references to resources\'s like JDBC resources, JMS resources, etc. configured outside the current application.'

<resource-env-ref>

The <context-root> uses the default namespaced described at
'The element resource-env-ref is used to map resource references to administrative objects deployed as a part of connectors.'

<naming:message-destination>

The <context-root> uses the default namespaced described at

References a message-destination (such as JMS queues), which is used within the deployed WAR file.

<security-realm-name>

The <context-root> uses the default namespaced described at

Specifies the name of the security realm that will be used for user authentication.

<app:security>

The <context-root> uses the default namespaced described at

Configures the security role mappings that will be used when deploying the module. Maps roles specified in the WAR file to roles or principals in the security realm

<sys:service>

The <context-root> uses the default namespaced described at

'Reference to abstract service element defined in imported \"geronimo-module-1.2.xsd\"'

<ee:persistence>

The <context-root> uses the default namespaced described at

...

default namespace is http://java.sun.com/xml/ns/javaee. The XML elements that do not have a namespace prefix belong to the default namespace.

...