天空是藍色的

          做好軟件為中國 #gcc -c helloworld.c -o helloworld.o //編譯目標文件 #gcc helloworld.o -o helloworld //編譯成可執行exe #helloworld //運行exe
          數據加載中……
          Extension Tapestry4`s restart service to clear my login cookies

          接上篇,自定義一個logout service 把我的login cookies 清楚掉

          Tapestry .java

          package common.tapestry;

          public final  class Tapestry {
            public static final String LOGOUT_SERVICE = "logout";
          }

          LogoutService.java
          package common.tapestry.engine;

          import java.io.IOException;

          import org.apache.tapestry.IRequestCycle;
          import org.apache.tapestry.engine.RestartService;

          import common.tapestry.Tapestry;

          public class LogoutService extends RestartService {
           private LoginCookiesManager loginCookiesManager;


           public void setLoginCookiesManager(
             LoginCookiesManager loginCookiesManager) {
            this.loginCookiesManager = loginCookiesManager;
           }

           public void service(IRequestCycle cycle) throws IOException {
            loginCookiesManager.removeCookies();
            super.service(cycle);
           }

           public String getName() {
            return Tapestry.LOGOUT_SERVICE;
           }
          }

          hivemodule.xml
          <?xml version="1.0"?>
          <module id="common.tapestry" version="1.0.0">

           <!-- extends tapestry RestartService and clear the login cookies info-->
              <service-point id="LogoutService" interface="org.apache.tapestry.engine.IEngineService">
                  <invoke-factory>
                      <construct class="common.tapestry.engine.LogoutService">
                       <set-service property="request" service-id="tapestry.globals.HttpServletRequest" />
                          <set-service property="response" service-id="tapestry.globals.HttpServletResponse" />
                          <set-object property="servletPath" value="app-property:org.apache.tapestry.servlet-path" />
                          <set-object property="linkFactory" value="infrastructure:linkFactory" />
                          <set-object property="loginCookiesManager" value="service:common.tapestry.LoginCookiesManager"/>
                       </construct>
                  </invoke-factory>
              </service-point>

              <contribution configuration-id="tapestry.services.ApplicationServices">
                  <service name="logout" object="service:common.tapestry.LogoutService" />
              </contribution>

          </module>

          in your Pages
          <a jwcid="@ServiceLink" href="#" service="ognl:@common.tapestry.Tapestry@LOGOUT_SERVICE" target="_top">退出</a>

          系原創
          作者其他blog  http://oxyc.spaces.live.com
                                  http://hiok.blog.sohu.com

          posted on 2008-03-24 15:34 bluesky 閱讀(2291) 評論(1)  編輯  收藏 所屬分類: 工作總結

          評論

          # re: Extension Tapestry4`s restart service to clear my login cookies 2016-06-14 14:59 http://www.antiquites-carrau.fr

          public class LogoutService extends RestartService {
            回復  更多評論    
          主站蜘蛛池模板: 临武县| 南漳县| 彩票| 文水县| 克东县| 和林格尔县| 阿拉善左旗| 库尔勒市| 永川市| 平顶山市| 肥乡县| 东至县| 云梦县| 南澳县| 永吉县| 南岸区| 英吉沙县| 崇明县| 广灵县| 江川县| 迁安市| 峨边| 丰台区| 吴堡县| 武定县| 绥阳县| 常宁市| 崇义县| 祁连县| 澄城县| 唐海县| 南溪县| 宝坻区| 普定县| 潞城市| 阳谷县| 聂荣县| 宁海县| 应城市| 兴山县| 永善县|