当前位置: 代码迷 >> J2EE >> myeclipse2014里filter-地图ping配置dispatcher报错
  详细解决方案

myeclipse2014里filter-地图ping配置dispatcher报错

热度:88   发布时间:2016-04-17 23:27:24.0
myeclipse2014里filter-mapping配置dispatcher报错
<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">
  相关解决方案