天空是藍(lán)色的

          做好軟件為中國 #gcc -c helloworld.c -o helloworld.o //編譯目標(biāo)文件 #gcc helloworld.o -o helloworld //編譯成可執(zhí)行exe #helloworld //運(yùn)行exe
          數(shù)據(jù)加載中……
          Extension Tapestry4`s restart service to clear my login cookies

          接上篇,自定義一個(gè)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>

          系原創(chuàng)
          作者其他blog  http://oxyc.spaces.live.com
                                  http://hiok.blog.sohu.com

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

          評論

          # 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 {
            回復(fù)  更多評論    
          主站蜘蛛池模板: 新巴尔虎左旗| 和田县| 天津市| 梁山县| 谷城县| 新竹县| 舞钢市| 青岛市| 米易县| 多伦县| 淄博市| 全椒县| 彰化市| 岳池县| 孝义市| 巴林右旗| 灵武市| 陇川县| 赤水市| 克东县| 麦盖提县| 义马市| 洛扎县| 扶风县| 永胜县| 中西区| 浦东新区| 桃园县| 花垣县| 乌拉特中旗| 垦利县| 海门市| 诏安县| 奎屯市| 永定县| 宣威市| 漳平市| 峡江县| 荆门市| 昌乐县| 南召县|