web.xml is a xml file ok,that means xml file should
follow the rules, 1.like every opening tag should be end tag
2.every attribute value must in single qotions(' ')or multiple (" ")
and
some other roles is like this:
for example:
<web-app>
<servlet>
<servlet-name>XXX</servlet-name>
</servlet-class>TestServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>XXX</servlet-name>
<url-pattern>/TestUrl</url-pattern>
</servlet-mapping>
</web-app>
this is correct xml file.
for eample if u write this :is incorrect
<web-app>
<servlet>
</servlet-class>TestServlet</servlet-class>
<servlet-name>XXX</servlet-name>
</servlet>
<servlet-mapping>
<servlet-name>XXX</servlet-name>
<url-pattern>/TestUrl</url-pattern>
</servlet-mapping>
</web-app>
(or)
<web-app>
<servlet>
<servlet-mapping>
<servlet-name>XXX</servlet-name>
<url-pattern>/TestUrl</url-pattern>
</servlet-mapping>
<servlet-name>XXX</servlet-name>
</servlet-class>TestServlet</servlet-class>
</servlet>
</web-app>
how to know this rules u will see the schema files
or dtd files in jar files.