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 劉錚 閱讀(286) 評論(0)  編輯  收藏 所屬分類: Tapestry

          <2025年7月>
          293012345
          6789101112
          13141516171819
          20212223242526
          272829303112
          3456789

          導航

          統計

          留言簿(1)

          文章分類(141)

          文章檔案(147)

          搜索

          最新評論

          主站蜘蛛池模板: 建德市| 象州县| 瑞金市| 昭苏县| 新余市| 张家川| 绥江县| 阜新市| 高邑县| 九台市| 石家庄市| 志丹县| 崇明县| 洛浦县| 宝兴县| 元氏县| 富蕴县| 平谷区| 南投县| 澄江县| 萨嘎县| 筠连县| 厦门市| 石城县| 陈巴尔虎旗| 诏安县| 麻栗坡县| 锡林郭勒盟| 来宾市| 碌曲县| 大石桥市| 宜章县| 和政县| 阜平县| 石台县| 湛江市| 德安县| 承德县| 石河子市| 黔江区| 天台县|