Interceptor 攔截器 與 的衝突
最近在學習攔截器,沒想到剛開始就碰到難題了。我明明配置好了攔截器,但是絲毫沒有起作用,百思不得其解。
這是起初的配置:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
< context:component-scan base-package = "sin.cara.controller" />
< mvc:annotation-driven /> < bean
class = "org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping" >
< property name = "interceptors" >
< list >
< ref bean = "myInterceptor" />
</ list >
</ property >
</ bean >
< bean id = "myInterceptor" class = "sin.cara.interceptors.MyInterceptors" />
< bean id = "viewResolver"
class = "org.springframework.web.servlet.view.InternalResourceViewResolver" >
< property name = "prefix" value = "/WEB-INF/views" />
|