zoukankan      html  css  js  c++  java
  • Struts2拦截器Interceptor执行顺序理解

    invocation.invoke()方法是拦截器框架的实现核心,通过确定invocation.invoke()方法执行位置,来实现Action执行前后处理操作,在invocation.invoke()方法之前的代码将依据配置中拦截器顺序依次执行,直到走完拦截器后再执行invocation.invoke()方法调用Action,然后再依据配置中拦截器顺序反向执行invocation.invoke()方法后的代码,直到走完拦截器

    如果我们有一个interceptor-stack的定义如下: 

    Xml代码  
    <interceptor-stack name="xaStack">   
      <interceptor-ref name="thisWillRunFirstInterceptor"/>   
      <interceptor-ref name="thisWillRunNextInterceptor"/>   
      <interceptor-ref name="followedByThisInterceptor"/>   
      <interceptor-ref name="thisWillRunLastInterceptor"/>   
    </interceptor-stack>   


    那么,整个执行的顺序大概像这样: 


  • 相关阅读:
    Bootstrap的datetimepicker插件使用
    值得关注几个博客
    Windows下安装和配置tomca(免安装版本)
    AC自动机
    反向输出链表
    替换空格
    二维数组中的查找
    windows下配置nginx+php环境
    HTTP协议详解
    leetcode.3Sum
  • 原文地址:https://www.cnblogs.com/hujiapeng/p/5121610.html
Copyright © 2011-2022 走看看