spring mvc web.xml文件配置中
<mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/login"/>
<ref bean="loginHandlerInterceptor"/>
</mvc:interceptor>
<mvc:interceptor>
<mvc:mapping path="/*"/>
<mvc:exclude-mapping path="/login"/>
<ref bean="watchHandlerInterceptor"/>
</mvc:interceptor>
</mvc:interceptors>
报错:
no declaration can be found for element 'mvc:interceptors'.
在xml文件开头beans里加上
xmlns:mvc="http://www.springframework.org/schema/mvc
xsi里加上
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd
就OK了