<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app id="WebApp_ID">
<display-name>servyou</display-name>
<filter>
<filter-name>login</filter-name>
<filter-class>servlet.servletfilter</filter-class>
</filter>
<filter-mapping>
<filter-name>login</filter-name>
<url-pattern>task.jsp</url-pattern>
</filter-mapping>
<servlet>
<servlet-name>Ser</servlet-name>
<display-name>This is the display name of my J2EE component</display-name>
<description>This is the description of my J2EE component</description>
<servlet-class>servlet.Ser</servlet-class>
</servlet>
<servlet-name>Ser</servlet-name>
<url-pattern>/login</url-pattern>
</servlet-mapping>
<servlet-mapping>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>login.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>
如果不增加filter的配置就正确,但是一添加就报错,报错信息为The content of element type "web-app" must match "(icon?,display-
name?,description?,distributable?,context-param*,servlet*,servlet-mapping*,session-config?,mime-
mapping*,welcome-file-list?,error-page*,taglib*,resource-ref*,security-constraint*,login-
config?,security-role*,env-entry*,ejb-ref*)".
Caballarii