在学SpringMVC的时候在web.xml中配置HiddenHttpMethodFilter出现了一些信息。
报错信息:
The content of element type "web-app" must match "(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)".
查看了报错信息发现我配置的顺序错误了。没有按照 web-app_2_3.dtd规范,我把HiddenHttpMethodFilter配置在了DispatcherServlet下面。
按照上面的报错信息,filter应该配置在servlet之前。
解决方案:
1.按照规定调整顺序,把filter配置在servlet之前。
2.删除头文件,即以下文件
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >