首页 > 编程语言 > 详细

Spring mvc:配置不拦截指定的路径

时间:2017-01-21 10:48:01      阅读:603      评论:0      收藏:0      [点我收藏+]
    <!-- 访问拦截  -->  
      <mvc:interceptors>
        <mvc:interceptor>
            <mvc:mapping path="/**/**"/>
            <!-- 不拦截的url -->
            <mvc:exclude-mapping path="/wechatController/"/>
            
            <bean class="com.cd.interceptor.LoginHandlerInterceptor"/>
        </mvc:interceptor>
    </mvc:interceptors>
     
因为mvc:exclude-mapping不被http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd 支持
所以要改成http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd 
即可.
不然会报错:
cvc-complex-type.2.4.a: Invalid content was found starting with element ‘mvc:exclude-mapping‘. One 
 of ‘{"http://www.springframework.org/schema/mvc":mapping, "http://www.springframework.org/
 schema/beans":bean}‘ is expected.

Spring mvc:配置不拦截指定的路径

原文:http://www.cnblogs.com/YangK-java/p/6336572.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!