//在SpringMVC的配置文件中配置
<mvc:interceptors>
<mvc:interceptor>
//拦截路径为/mvc/**的请求
<mvc:mapping path="/mvc/**"/>
//注入拦截器所在的类
<bean class="test.SpringMVC.Interceptor.MyInterceptor"></bean>
</mvc:interceptor>
</mvc:interceptors>