SpringMVC中的拦截器用于拦截控制器方法的执行
    SpringMVC中的拦截器需要实现HandlerInterceptor
    SpringMVC的拦截器必须在SpringMVC的配置文件中进行配置:

    1. <bean class="com.atguigu.interceptor.FirstInterceptor"></bean>
    2. <ref bean="firstInterceptor"></ref>
    3. <!-- 以上两种配置方式都是对DispatcherServlet所处理的所有的请求进行拦截 -->
    4. <mvc:interceptor>
    5. <mvc:mapping path="/**"/>
    6. <mvc:exclude-mapping path="/testRequestEntity"/>
    7. <ref bean="firstInterceptor"></ref>
    8. </mvc:interceptor>
    9. <!--以上配置方式可以通过ref或bean标签设置拦截器,通过mvc:mapping设置需要拦截的请求,通过 mvc:exclude-mapping设置需要排除的请求,即不需要拦截的请求 -->