...
In the geronimo-web.xml
file, application deployer maps the security roles, ejb names, database resources, JMS resources, etc. declared in web.xml
to corresponding entities deployed in the server. In addition to that, if there are any web container specific configurations, such as tomcat or jetty specific, depending on the application needs, all these settings are configured as well here. If the web application depends on any third party libraries or other services running in the server, all these dependencies are declared in the plan. Some web applications require class loading requirements different from the default class loading behavior. The geronimo-web.xml
allows application deployer to configure this as well. There are many more configurations that could be done through geronimo-web.xml
depending on the needs of web application. The following sections briefly explain how geronimo-web.xml
can be used to configure the web container and web applications.
The geronimo-web.xml
uses XML elements from http://geronimo.apache.org/xml/ns/j2ee/web-2.0.1 namespace and one or more namespaces mentioned in Common elements and Configuration section above in the document. Please go through the section to know what elements does each schema describe.
For example, the following web.xml
and geronimo-web.xml
are the deployment descriptor and geronimo deployment plan respectively, of a web application that connects to a datasource deployed on DB2 and retrieves data from a table.
...
The web module connects to back end datasource using its JNDI name jdbc/DataSource
as specified declared in the web.xml
.
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:sec="http://geronimo.apache.org/xml/ns/security-2.0" xmlns:sys="http://geronimo.apache.org/xml/ns/deployment-1.2"> <sys:environment> <sys:moduleId> <sys:groupId>samples</sys:groupId> <sys:artifactId>EmployeeDemo</sys:artifactId> <sys:version>2.5</sys:version> <sys:type>war</sys:type> </sys:moduleId> <sys:dependencies> <sys:dependency> <sys:groupId>samples</sys:groupId> <sys:artifactId>EmployeeDatasource</sys:artifactId> <sys:version>2.5</sys:version> <sys:type>rar</sys:type> </sys:dependency> </sys:dependencies> </sys:environment> <context-root>/EmployeeDemo</context-root> <naming:resource-ref> <naming:ref-name>jdbc/DataSource</naming:ref-name> <naming:resource-link>jdbc/EmployeeDatasource</naming:resource-link> </naming:resource-ref> </web-app> |
...
The above descriptor and the plan files are the simple illustrations that explain how web modules are developed and assembled for apache geronimo. Similarly, many other configurations can be performed in the geronimo-web.xml
. The schema for the plan is http://geronimo.apache.
org/xml
/ns/j2ee/web-2. 0.1
All the XML schema files are located at <geronimo_home>/schema
directory. Please go through the .xsd
files to have a feel of XML tags that can be used in geronimo-web.xml
for configuring web applications.