zoukankan      html  css  js  c++  java
  • 拦截器的配置和执行流程

     1 <!-- 配置拦截器 -->
     2 <mvc:interceptors>
     3     <mvc:interceptor>
     4         <!-- 所有的请求都进入拦截器 -->
     5         <mvc:mapping path="/**" />
     6         <!-- 配置具体的拦截器 -->
     7         <bean class="cn.itcast.ssm.interceptor.HandlerInterceptor1" />
     8     </mvc:interceptor>
     9     <mvc:interceptor>
    10         <!-- 所有的请求都进入拦截器 -->
    11         <mvc:mapping path="/**" />
    12         <!-- 配置具体的拦截器 -->
    13         <bean class="cn.itcast.ssm.interceptor.HandlerInterceptor2" />
    14     </mvc:interceptor>
    15 </mvc:interceptors>

    总结:

    preHandle按拦截器定义顺序调用

    postHandler按拦截器定义逆序调用

    afterCompletion按拦截器定义逆序调用

    postHandler在拦截器链内所有拦截器返成功调用

    afterCompletion只有preHandle返回true才调用

    天下无难事,只要肯攀登!见多识广是多么重要!
  • 相关阅读:
    1113. Integer Set Partition (25)
    1110. Complete Binary Tree (25)
    1109. Group Photo (25)
    Bender Problem
    格子中输出
    牌型种数
    移动距离
    QQ帐户的申请与登陆(25 分)
    词频统计
    基于HTTP的直播点播HLS
  • 原文地址:https://www.cnblogs.com/Allen-Wei/p/9009315.html
Copyright © 2011-2022 走看看