相关报错信息:Caused by: org.xml.sax.SAXParseException; lineNumber: 79; columnNumber: 61; cvc-complex-type.2.4.a: 发现了以元素 'bean' 开头的无效内容。应以 '{"http://www.springframework.org/schema/mvc":mapping}' 之一开头。
springMVC 拦截器错误版本:
<!--配置springMVC 权限拦截 -->
<mvc:interceptors>
<mvc:interceptor>
<!-- 匹配的是url路径, 如果不配置或/**,将拦截所有的Controller -->
<!--<mvc:mapping path="/**" /> -->
<bean class="com.wlsq.kso.filter.UserInterceptor"/>
</mvc:interceptor>
<!-- 当设置多个拦截器时,先按顺序调用preHandle方法,然后逆序调用每个拦截器的postHandle和afterCompletion方法 -->
</mvc:interceptors>
springMVC拦截器正确版本:
<!--配置springMVC 权限拦截 -->
<mvc:interceptors>
<mvc:interceptor>
<!-- 匹配的是url路径, 如果不配置或/**,将拦截所有的Controller -->
<mvc:mapping path="/**" />
<bean class="com.wlsq.kso.filter.UserInterceptor"/>
</mvc:interceptor>
<!-- 当设置多个拦截器时,先按顺序调用preHandle方法,然后逆序调用每个拦截器的postHandle和afterCompletion方法 -->
</mvc:interceptors>