...
This schema is not container-independentspecific, meaning that it can be used to deploy a web application to either of the Tomcat or Jetty web containers supported by Geronimo. If it is necessary to deploy to a specific container, one of the two following container-specific schemas can be used instead. These allow container-specific configuration elements that are only understood by either the Tomcat or Jetty web container.
- http://geronimo.apache.org/schemas-2.1/docs/geronimo-tomcat-2.0.1.xsd.html
- http://geronimo.apache.org/schemas-2.1/docs/geronimo-jetty-2.0.2.xsd.html
This schema is container-independent, meaning that it can be used to deploy to Simileither of the Tomcat or Jetty web containers supported by Geronimo. If it is necessary to deploy to a specific container, one of the following schemas can be used instead. These allow container-specific configuration elements that are only understood by either the Tomcat or Jetty web container. Additionally, while the container-independent Finally, while the generic schema has no container-specific elements, it does faciliate the inclusion of container-specific elements by using the <container-config> element. This element is described in more detail below.
...
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1" xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2" xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2"> <sys:environment> <sys:moduleId> <sys:groupId>default</sys:groupId> <sys:artifactId>geronimo-web-6</sys:artifactId> <sys:version>1.0</sys:version> <sys:type>car</sys:type> </sys:moduleId> <sys:dependencies>dependencies/> <sys:hidden-classes/> <sys:dependency>non-overridable-classes/> <sys:inverse-classloading/> <sys:groupId>org.apache.geronimo.configs</sys:groupId>suppress-default-environment/> </sys:environment> <context-root>contextroot</web:context-root> <sys:artifactId>tomcat6</sys:artifactId> <work-dir>workdir</web:work-dir> <naming:web-container> <sys:version>2.1.1</sys:version><naming:gbean-link>TomcatWebAppContainer</naming:gbean-link> </naming:web-container> <gbean name="TomcatWebAppContainer" class="org.apache.geronimo.tomcat.TomcatContainer"> <sys:type>car</sys:type> <attribute name="catalinaHome">var/catalina</attribute> </sys:dependency> <reference name="EngineGBean"> <sys:dependency><name>TomcatEngine1</name> </reference> <sys:groupId>default</sys:groupId><reference name="ServerInfo"> <sys:artifactId>geronimo-web-5</sys:artifactId><name>ServerInfo</name> </reference> <sys:version>1.0</sys:version><reference name="WebManager"> <sys:type>car</sys:type><name>TomcatWebManager</name> </sys:dependency> reference> </sys:dependencies>gbean> <gbean <sys:hidden-classes/> name="TomcatWebAppEngine" class="org.apache.geronimo.tomcat.EngineGBean"> <sys:non-overridable-classes/><attribute name="className">org.apache.geronimo.tomcat.TomcatEngine</attribute> <sys:inverse-classloading/<attribute name="initParams"> <sys:suppress-default-environment/> </sys:environment> name=WASCE <context-root>contextroot</web:context-root> <work-dir>workdir</web:work-dir></attribute> <naming:web-container> <reference name="DefaultHost"> <naming:gbean-link>TomcatWebAppContainer</naming:gbean-link> </naming:web-container> <name>TomcatHost1</name> <gbean name="TomcatWebAppContainer" class="org.apache.geronimo.tomcat.TomcatContainer"> </reference> <attribute<references name="catalinaHome">var/catalina</attribute>Hosts"> <reference name="EngineGBean"> <pattern> <name>TomcatEngine1</name> <<name>TomcatHost</reference>name> <reference name="ServerInfo </pattern> </references> <reference name="RealmGBean"> <name>TomcatJAASRealm</name> </reference> <reference name="TomcatValveChain"> <name>ServerInfo<<name>FirstValve</name> </reference> <reference name="WebManagerLifecycleListenerChain"> <name>TomcatWebManager<<name>FirstListener</name> </reference> </gbean> <gbean name="TomcatWebAppEngineTomcatWebAppHost" class="org.apache.geronimo.tomcat.EngineGBeanHostGBean"> <attribute name="className">org.apache.geronimocatalina.tomcatcore.TomcatEngine<StandardHost</attribute> <attribute name="initParams"> name=WASCElocalhost </attribute> <reference name="DefaultHost">appBase= <name>TomcatHost1</name>workDir=work </reference>attribute> </gbean> <references<gbean name="HostsTomcatWebAppConnector" class="org.apache.geronimo.tomcat.ConnectorGBean"> <attribute name="name">HTTP</attribute> <pattern> <attribute name="host">localhost</attribute> <name>TomcatHost</name> <attribute name="port">8081</attribute> </pattern> </references> <reference name="RealmGBean"> <!-- Use port 8081 instead of the default of 8080 --> <name>TomcatJAASRealm</name> <attribute name="maxHttpHeaderSizeBytes">8192</attribute> </reference> <reference<attribute name="TomcatValveChainmaxThreads">>150</attribute> <name>FirstValve</name><attribute name="minSpareThreads">25</attribute> </reference><attribute name="maxSpareThreads">75</attribute> <reference<attribute name="LifecycleListenerChainhostLookupEnabled">>false</attribute> <attribute name="redirectPort">8453</attribute> <name>FirstListener</name> </reference> </gbean> <gbean<attribute name="TomcatWebAppHost" class="org.apache.geronimo.tomcat.HostGBean">acceptQueueSize">100</attribute> <attribute name="className">org.apache.catalina.core.StandardHost<connectionTimeoutMillis">20000</attribute> <attribute name="initParamsuploadTimeoutEnabled">>false</attribute> <reference name=localhost"TomcatContainer"> appBase=<name>TomcatWebAppContainer</name> workDir=work</reference> </attribute> gbean> </gbean> <gbean name="TomcatWebAppConnector" class="org.apache.geronimo.tomcat.ConnectorGBean"> <attribute name="name">HTTP</attribute> <attribute name="host">localhost</attribute> <attribute name="port">8081</attribute> <!-- Use port 8081 instead of the default of 8080 --> <attribute name="maxHttpHeaderSizeBytes">8192</attribute> <attribute name="maxThreads">150</attribute> <attribute name="minSpareThreads">25</attribute> <attribute name="maxSpareThreads">75</attribute> <attribute name="hostLookupEnabled">false</attribute> <attribute name="redirectPort">8453</attribute> <attribute name="acceptQueueSize">100</attribute> <attribute name="connectionTimeoutMillis">20000</attribute> <attribute name="uploadTimeoutEnabled">false</attribute> <reference name="TomcatContainer"> <name>TomcatWebAppContainer</name> </reference> </gbean> </web-app> |
<container-config>
The <container-config> XML element uses the Geronimo default namespace for the geronimo-web.xml file that is described here:
This element is used for the configuration of elements specific to the underlying Geronimo web container (i.e., Jetty or
Tomcat). An example geronimo-web.xml file is shown below using the <container-config> elements for the Tomcat web container:
web-app>
|
<container-config>
As previously mentioned, there are actually three schemas that can be used for the geronimo-web.xml file. The first is container-independent and can be used to deploy a web application to either of the web containers supported by Geronimo. The second two are container-dependent that contain elements specific to either the Tomcat or Jetty web container:
- http://geronimo.apache.org/schemas-2.1/docs/geronimo-web-2.0.1.xsd.html
- http://geronimo.apache.org/schemas-2.1/docs/geronimo-tomcat-2.0.1.xsd.html
- http://geronimo.apache.org/schemas-2.1/docs/geronimo-jetty-2.0.2.xsd.html
Which to use is left to the discretion of the user. If a web application is meant to be deployed to both Tomcat and Jetty, then the generic schema is typically used, and if a web application is meant to be deployed to only Tomcat or Jetty, then one of the container-specific schemas is typically used. However, another option is available since the generic schema allows the inclusion of the container-specific elements found in the container-specific schemas by using the <container-config> element. This allows the user to use the generic schema even when the web application requires container-specific configuration for Tomcat or Jetty (or both). An example geronimo-web.xml file is shown below using the <container-config> element to configure the Tomcat web container. Note that the <host>, <valve-chain>, and <tomcat-realm> elements are understood only by the Tomcat container, not Jetty:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1"
xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2">
<sys:environment>
<sys:moduleId> | ||||||||
Code Block | ||||||||
xml | xml | |||||||
borderStyle | solid | |||||||
title | <container-config> Example | <web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1" xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2" xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2"> <sys:environment> <sys:moduleId> <sys:groupId>default</sys:groupId> <sys:artifactId>geronimo-web-6</sys:artifactId> <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.1.1</sys:version> <sys:type>car</sys:type> </sys:dependency> <sys:dependency> <sys:groupId>default</sys:groupId> <sys:artifactId>geronimo-web-5</sys:artifactId> <sys:version>1.0</sys:version> <sys:type>car</sys:type> </sys:dependency> </sys:dependencies> <sys:hidden-classes/> <sys:non-overridable-classes/> <sys:inverse-classloading/> <sys:suppress-default-environment/> </sys:environment> <context-root>contextroot</web:context-root> <work-dir>workdir</web:work-dir> <naming:web-container> <naming:pattern> <naming:groupId>gbeanlocator-pattern-groupid</naming:groupId> <naming:artifactId>gbeanlocator-pattern-artifactid</naming:artifactId> <naming:version>gbeanlocator-pattern-version</naming:version><sys:groupId>default</sys:groupId> <naming<sys:module>gbeanlocatorartifactId>geronimo-patternweb-module<6</namingsys:module>artifactId> <naming:name>gbeanlocator-pattern-name</naming:name><sys:version>1.0</sys:version> </naming:pattern> <sys:type>car</sys:type> <naming:gbean-link>gbeanlocator-gbeanlink</naming:gbean-link></sys:moduleId> </naming:web-container>sys:environment> <container-config> <tomcat xmlns="http://geronimo.apache.org/xml/ns/web/tomcat/config-1.0"> <host>testhost.com</host> <valve-chain>FirstValve</valve-chain> <tomcat-realm>TomcatRealm</tomcat-realm> </tomcat> </container-config> </web-app> |
...