Structure for Deployment Descriptor (web.xml)

  • Posted on: 4 August 2013
  • By: Zhijun Chen

Deployment Descriptor

* - Optional(0 or more)        ? – Optional(0 or 1)              + - 1 or more         1 – Required(exactly 1)

Note: All elements under web app are marked as *.

<web-app>

<description>*</description>

<display-name>*</display-name>

<icon>

       <small-icon>*</small-icon>

       <large-icon>*</large-icon>

</icon>

<distributable>*</distributable>

<context-param>

       <description>*</description>

       <param-name>1</param-name>

       <param-value>1</param-value>

</context-param>

<filter>

       <description>*</description>

       <display-name>*</display-name>

       <icon>*</icon>

       <filter-name>1</filter-name>

       <filter-class>1</filter-class>

       <init-param>*

              <description>*</description>

              <param-name>1</param-name>

              <param-value>1</param-value>

       </init-param>

</filter>

<filter-mapping>

       <filter-name>1</filter-name>

       <url-pattern>1, xor to servlet-name</url-pattern>

       <servlet-name>1, xor to url-pattern</servlet-name>

       <dispatcher>0 to 4, FORWARD, INCLUDE, REQUEST, ERROR</dispatcher>

</filter-mapping>

<listener>

       <description>*</description>

<display-name>*</display-name>

<icon>*</icon>

<listener-class>1</listener-class>

</listener>

<servlet>

       <description>*</description>

       <display-name>*</display-name>

       <icon>*</icon>

       <servlet-name>1</servlet-name>

       <servlet-class>1, xor to jsp-file</servlet-class>

       <jsp-file>1, xor to servlet-class</jsp-file>

       <init-param>*

              <description>*</description>

              <param-name>1</param-name>

              <param-value>1</param-value>

       </init-param>

       <load-on-startup>?</load-on-startup>

       <run-as>?</run-as>

       <security-role-ref>*

              <description>*</description>

              <role-name>1</role-name>

              <role-link>?</role-link>

</security-role-ref>

</servlet>

<servlet-mapping>

       <servlet-name>1</servlet-name>

       <url-pattern>1</url-pattern>

</servlet-mapping>

<session-config>

       <session-timeout>?, in minutes</session-timeout>

</session-config>

<mime-mapping>

       <extension>1</extension>

       <mime-type>1</mime-type>

</mime-mapping>

<welcome-file-list>

       <welcome-file>+</welcome-file>

</welcome-file-list>

<error-page>

       <error-code>1, xor to exception-type</error-code>

       <exception-type>1, xor to error-code</exception-type>

       <location>1</location>

</error-page>

<jsp-config>

       <description>*</description>

       <display-name>*</display-name>

       <icon>*</icon>

       <taglib>*

       <taglib-uri>1</taglib-uri>

       <taglib-location>1</taglib-location>

</taglib>

<jsp-property-group>*

       <description>*</description>

       <display-name>*</display-name>

       <icon>*</icon>

       <url-pattern>+</url-pattern>

       <el-ignored>?</el-ignored>

       <page-encoding>?</page-coding>

       <scripting-invalid>?</scripting-invalid>

       <is-xml>?</is-xml>

       <include-prelude>*</include-prelude>

       <include-coda>*</include-coda>

</jsp-property-group>

</jsp-config>

<security-constraint>

       <display-name>*</display-name>

       <web-resource-collection>+

              <web-resource-name>1</web-resource-name>

              <url-pattern>+</url-pattern>

              <http-method>*, GET, POST, PUT, DELETE, etc.</http-method>

       </web-resource-collection>

       <auth-constraint>?

              <role-name>*</role-name>

       </auth-constraint>

<user-data-constraint>

       <transport-guarantee>

NONE, INTEGRAL, CONFIDENTIAL

</transport-gurantee>

</user-data-constraint>

</security-constraint>

<login-config>

       <auth-method>?, BASIC, DIGEST, CLIENT-CERT, FORM</auth-method>

       <realm-name>?, not required for CLIENT-CERT, FORM</realm-name>

       <form-login-config> only for FORM auth-method

              <form-login-page>1</form-login-page>

              <form-error-page>1</form-error-page>

       </form-login-config>

</login-config>

<security-role>

       <role-name>1</role-name>

</security-role>

<env-entry></env-entry>

<ejb-ref>

       <ejb-ref-name></ejb-ref-name>

       <ejb-ref-type></ejb-ref-type>

       <ejb-ref-home></ejb-ref-home>

       <ejb-ref-remote></ejb-ref-remote>

</ejb-ref>

<ejb-local-ref></ejb-local-ref>

<service-ref></service-ref>

<resource-ref>

       <description>*</description>

       <res-ref-name></res-ref-name>

       <res-type></res-type>

       <res-auth></res-auth>

</resource-ref>

<resource-env-ref></resource-env-ref>

</web-app>

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.