J2EE - Web.xml (Deployment descriptor of a Web Application)

> Procedural Languages > Java

1 - About

The web.xml file is the deployment descriptor file for a web application.

It's a J2EE standard XML document that configures the contents of a WAR file.

You can override any of the default servlet parameters at the Web application level by specifying corresponding <init-param> elements in the J2EE standard web.xml deployment descriptor.

Advertising

3 - Example

<web-app>
 
    <display-name>gerardnico.com</display-name>
 
    <description>
      gerardnico.com
    </description>
 
    <welcome-file-list>
       <welcome-file>index.html</welcome-file>
    </welcome-file-list>
 
</web-app>

4 - Structure

4..1 - Start Page

The start page for the application is defined with the welcome-file tag.

Example:

<web-app>
...
  <welcome-file>
    myWelcomeFile.jsp
  </welcome-file>
...
</web-app>

It's default value is:

  • name: index,
  • Extension: .html, .htm, or .jsp

4..2 - Global Parameter (context-param)

lang/java/web.xml.txt · Last modified: 2018/09/20 10:53 by gerardnico