<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ## 自定義攔截器 MyIntercept1: ~~~ package com.like.intercept; import com.opensymphony.xwork2.ActionInvocation; import com.opensymphony.xwork2.interceptor.Interceptor; public class MyIntercept1 implements Interceptor { @Override public void destroy() {} @Override public void init() {} @Override public String intercept(ActionInvocation actionInvocation) throws Exception { System.out.println("intercept1 before"); //放行 String invoke = actionInvocation.invoke(); System.out.println("intercept1 after"); return invoke; //返回一個別名 } } ~~~ MyIntercept2: ~~~ package com.like.intercept; import com.opensymphony.xwork2.ActionInvocation; import com.opensymphony.xwork2.interceptor.Interceptor; public class MyIntercept2 implements Interceptor { @Override public void destroy() {} @Override public void init() {} @Override public String intercept(ActionInvocation actionInvocation) throws Exception { System.out.println("intercept2 before"); //放行 String invoke = actionInvocation.invoke(); System.out.println("intercept2 after"); return invoke; } } ~~~ struts2.xml: ~~~ <package name="default" namespace="/" extends="struts-default"> <!--為package下面所有action申明攔截器--> <interceptors> <!--申明攔截器--> <interceptor name="MyIntercept1" class="com.like.intercept.MyIntercept1"/> <interceptor name="MyIntercept2" class="com.like.intercept.MyIntercept2"/> <!--申明攔截器組--> <interceptor-stack name="MyIntercepts"> <!--調用默認組.不調用會導致struts2原有功能無法使用--> <interceptor-ref name="defaultStack"/> <!--攔截器組所使用的攔截器名--> <interceptor-ref name="MyIntercept1"/> <interceptor-ref name="MyIntercept2"/> </interceptor-stack> </interceptors> <!--執行在訪問action的時候需要執行的攔截器組--> <default-interceptor-ref name="MyIntercepts"/> <action name="index" class="com.like.HelloAction" method="index"> <!--為單個action指定攔截器.可以指定單個攔截器,也可以指定攔截器組--> <!--如果指定了單個攔截器,那么為package申明全局的所有攔截器(包括默認)將不作用于此--> <interceptor-ref name="MyIntercept1"/> <result name="success" type="dispatcher">/index.jsp</result> </action> </package> ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看