java中配置自定義攔截器中exclude-mapping path是什么意思?


  1. <mvc:interceptors>  
  2.     <mvc:interceptor>  
  3.         <mvc:mapping path="/**"/>//過濾全部請求  
  4.         <mvc:exclude-mapping path="/hello.html"/> //除了hello這個請求  
  5.         <bean class="net.spring.interceptor.TestInterceptor" />  
  6.     </mvc:interceptor>  
  7. </mvc:interceptors>  


把http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd改成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.

因為mvc:exclude-mapping 標簽不被spring-mvc-3.0.xsd支持,該配置在spring-mvc-3.2.xsd中


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM