Invalid content was found starting with element 'mvc:exclude-mapping'.
问题?Invalid content was found starting with element 'mvc:exclude-mapping'.
这是springmvc中显著的错误,在配置拦截器的时候,会用到不拦截某一些请求
如:
- < mvc:interceptors>
- <span style="white-space:pre"> </span>< mvc:interceptor>
- <span style="white-space:pre"> </span>< mvc:mapping path=”/**”/>//过滤全部请求
- <span style="white-space:pre"> </span>< mvc:exclude-mapping path=”/hello.html”/> //除了hello这个请求
- <span style="white-space:pre"> </span>< bean class=”net.spring.interceptor.TestInterceptor” />
- <span style="white-space:pre"> </span></mvc:interceptor>
- </mvc:interceptors>
< mvc:exclude-mapping path=”/hello.html”/> //除了hello这个请求
这条语句就会出问题?会报以上的错误,Invalid content was found starting with element 'mvc:exclude-mapping'.原因是:mvc:exclude-mapping
标签不被spring-mvc-3.0.xsd支持,该配置在spring-mvc-3.2.xsd中支持。
把http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd改成http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd