<filter>
<filter-name>CharacterFilter</filter-name>
<filter-class>cn.liyin.web.filter.CharacterFilter</filter-class>
<init-param>
<param-name>charset</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CharacterFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
</filter-mapping>的子标签里面没有<dispatcher>这一选项
鼠标放<filter-mapping>错误提示:The content of element type "filter-mapping" must match "(filter-name,(url-pattern|servlet-name))".
------解决思路----------------------
web.xml里<web-app>标签里的版本指定多少?引用的xsd文件的版本多少?我的3.0如下:
<web-app 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"
version="3.0">