To package a web application to be deployable in multiple container, deployment descriptor is needed for each of the specific container. The deployment descriptor web.xml is the standard descriptor for the servlet container.

Lets take example for a war to be deployable at Tomcat, Weblogic, Jboss

Deployment Desscriptor.

Java web applications use a deployment descriptor file to determine how URLs map to servlets, which URLs require authentication, and other information. This file is named web.xml, and resides in the app’s WAR under the WEB-INF/ directory For more information, refer google cloud platform web.xml and Metawerx web.xml reference wiki

Servlet container uses this deployment descriptor to determine the deployment of the web application.

Example web.xml: Here servlets are declared and the corresponding servlet mapping. The security is manage why the container.



Weblogic

For the weblogic deployment, weblogic has its own weblogic specific deployment descriptor. This is used only when deployed in the weblogic container and named as ‘weblogic.xml’. It resides at the same location as the web.xml.

If weblogic.xml deployment descriptor is absent, WebLogic Server automatically selects the default values of the deployment descriptor elements.

For more information, refer weblogic deployment descriptor.

Here is an example weblogic.xml: The prefer-application-packages here direct weblogic to load the classes that are in the war rather then the in-build/included in the weblogic library. The roles of the security is defined as well.



Jboss

Jboss also has its own deployment descriptor that get used when deployed in jboss servlet container only and its named as jboss-web.xml, its also used to overrite setting in the web.xml. It resides at the same location as the web.xml.

For more information, refer JBoss Web Application Deployment Descriptor. Refer here for the complete list of deployment descriptor of Jboss.

Example jboss-web.xml to declare the context root only and get all inherite the description from web.xml. The security roles are inherited from the web.xml.



jboss-deployment-structure.xml

This file is used to control the class loading for the deployment. Here the logging classes are excluded as its already present in the war.



For the full project reference visit redis-device-oui