zoukankan      html  css  js  c++  java
  • Struts2的拦截器配置

    1:引入默认的时间拦截器

        <!-- 引入拦截器和引入拦截器栈一样的语法 -->

         <interceptor-ref name="defaultStack"></interceptor-ref>

                <!-- 引入时间拦截器 -->

         <interceptor-ref name="timer"></interceptor-ref>

    2:自定义时间拦截器的引(引入package标签中)

    <!-- 自定义拦截器栈 -->

         <interceptors>

    <interceptor-stack name="myStack">

    <!-- 配置时间拦截器 -->

         <interceptor-ref name="timer"></interceptor-ref>

         <!-- 引入默认的拦截器 -->

         <interceptor-ref name="defaultStack"></interceptor-ref>

    </interceptor-stack>     

         </interceptors> 

    ation中引入自定义的拦截器栈

    <interceptor-ref name="myStack"></interceptor-ref>

    3: 自定义拦截器栈的引入

    <!-- 自定义拦截器栈 -->

         <interceptors>

         <!-- 自定义拦截器类 -->

         <interceptor name="my01" class="com.baidu.intercept.MyIntercept01"></interceptor>

        

         <!-- 引入拦截器 -->

    <interceptor-stack name="myStack">

    <interceptor-ref name="my01"></interceptor-ref>

    <!-- 引入默认的拦截器 -->

         <interceptor-ref name="defaultStack"></interceptor-ref>

    </interceptor-stack>     

     </interceptors> 

    ation中引入自定义的拦截器栈

    <interceptor-ref name="myStack"></interceptor-ref>

    也可将<interceptor-ref name="myStack"></interceptor-ref>此配置转化成<default-interceptor-ref name="myStack"></default-interceptor-ref>

    山重水复疑无路,柳暗花明又一村! 专注填坑,少走弯路!
  • 相关阅读:
    网络科学导论【第二章】读书脑图
    稳定匹配
    Machine learning(3-Linear Algebra Review )
    Machine learning(2-Linear regression with one variable )
    Machine learning(1-Introduction)
    1710. Maximum Units on a Truck (E)
    0729. My Calendar I (M)
    0105. Construct Binary Tree from Preorder and Inorder Traversal (M)
    0746. Min Cost Climbing Stairs (E)
    0128. Longest Consecutive Sequence (M)
  • 原文地址:https://www.cnblogs.com/mqflive81/p/10645019.html
Copyright © 2011-2022 走看看