Tapestry中防止惡意用戶登陸的方法,即保護頁面的方法

          Page的java文件要實現PageValidateListener接口,
          完成pageValidate(PageEvent event)方法
          注意public void pageValidate(PageEvent event) {
          if (!getUserExists()) {
          Login login = getLoginPage();
          login.setNextPage("Confirm");
          throw new PageRedirectException(login);
          }
          }
          注意這里要用PageRedirectException方法,因為As the rendering
          has begun, calling activate() will have no
          effect. To interrupt the rendering of the
          current page and render another page,
          you need to throw a
          PageRedirectException.

          這里是服務器內部跳轉
          The URL displayed in the
          browser will not be changed
          because the redirection
          happens inside Tapestry
          only.

          posted on 2007-11-05 11:33 劉錚 閱讀(282) 評論(0)  編輯  收藏 所屬分類: Tapestry

          <2025年5月>
          27282930123
          45678910
          11121314151617
          18192021222324
          25262728293031
          1234567

          導航

          統計

          留言簿(1)

          文章分類(141)

          文章檔案(147)

          搜索

          最新評論

          主站蜘蛛池模板: 岳阳市| 荆州市| 巫山县| 德昌县| 宜城市| 青海省| 天全县| 博野县| 古交市| 龙海市| 湖口县| 丘北县| 涞水县| 伽师县| 黔西县| 句容市| 扎赉特旗| 固原市| 岐山县| 罗定市| 孟津县| 秦皇岛市| 崇州市| 中超| 四川省| 绥芬河市| 彝良县| 吴桥县| 万年县| 岳池县| 祁连县| 阿拉善右旗| 财经| 容城县| 盘锦市| 海兴县| 新民市| 台中市| 克拉玛依市| 财经| 兴仁县|