It is a deployment descriptor which determines the application to server.
<?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.
<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> <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-on-startup>1</load-on-startup>
Numeric value specify the order of servlets
<context-param> <param-name>myParam</param-name> <param-value>the value</param-value> </context-param>
<session-config> <session-timeout>20</session-timeout> </session-config>