The Web. xml file has versions 2.3, 2.4, 2.5, and 3.0, which have a very important configuration difference:
This can be configured in the servlet version 2.5, where multiple URLs are mapped to the same servlet. Specific as follows.
<servlet-mapping>
<servlet-name>servletName</servlet-name>
<url-pattern>/index</url-pattern>
<url-pattern>/login</url-pattern>
</servlet-mapping>
Not in 2.3 or 2.4.
Servlet 2.3
<?xml version= "1.0″encoding=" utf-8″?>
<! DOCTYPE Web-app
Public "-//sun Microsystems, INC.//DTD Web application 2.3//en"
"Http://java.sun.com/dtd/web-app_2_3.dtd" >
<web-app>
...
</web-app>
Servlet 2.4
<?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/J2EE"
xmlns:web= "Http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
xsi:schemalocation= "Http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
Version= "2.4″>
...
</web-app>
Servlet 2.5
<?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"
xmlns:web= "Http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemalocation= "Http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
Id= "webapp_id" version= "2.5″>
Servlet 3.0
<?xml version= "1.0″encoding=" utf-8″?>
<web-app version= "3.0″
Xmlns= "Http://java.sun.com/xml/ns/javaee"
Xmlns:xsi= "Http://www.w3.org/2001/XMLSchema-instance"
Xsi:schemalocation= "Http://java.sun.com/xml/ns/javaee
Http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd ">
Web. xml files 2.3, 2.4, 2.5, 3.0 different version issues