Deployment Descriptor

Web.xml:

It is a deployment descriptor which determines the application to server.

Sample web.xml:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
   xmlns="http://java.sun.com/xml/ns/javaee" 
   xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
   http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
   id="App_ID" version="3.0">
   
  <display-name>ServletExample</display-name>

  <welcome-file-list>
	<welcome-file>login.html</welcome-file>
  </welcome-file-list>

</web-app>

Display name specify application display name.

Welcome file specify the entry page for your application.

Various other part of web.xml:

Servlet Mapping and config parameter:

<servlet>
        <servlet-namevErrorHandler</servlet-name>
        <servlet-class>ErrorHandler</servlet-class>
	<init-param>
	  <param-name>name</param-name>
	  <param-value>value</param-value>
        </init-param>
</servlet>

<servlet-mapping>
        <servlet-name>ErrorHandler</servlet-name>
        <url-pattern>/ErrorHandler</url-pattern>
</servlet-mapping>

Filter Mapping and config parameter:

<filter>
   <filter-name>LogFilter</filter-name>
   <filter-class>LogFilter</filter-class>
   <init-param>
	  <param-name>name</param-name>
	  <param-value>value</param-value>
   </init-param>
</filter>
<filter-mapping>
   <filter-name>LogFilter</filter-name>
   <url-pattern>/*/url-pattern>
</filter-mapping>

Load servlet on start up:

<load-on-startup>1</load-on-startup>

Numeric value specify the order of servlets

Context param:

<context-param>
    <param-name>myParam</param-name>
    <param-value>the value</param-value>
</context-param>

Session Timeout: 20min

<session-config>
  <session-timeout>20</session-timeout>
</session-config>