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)

          搜索

          最新評論

          主站蜘蛛池模板: 乐亭县| 庆云县| 长沙县| 宜川县| 崇礼县| 宁河县| 万山特区| 新邵县| 鄯善县| 五寨县| 营口市| 公安县| 大余县| 南宁市| 清涧县| 桂平市| 临清市| 来安县| 锦州市| 泽库县| 郁南县| 怀化市| 咸宁市| 甘南县| 万山特区| 修水县| 文水县| 大足县| 宜都市| 横山县| 宁都县| 雅江县| 突泉县| 赣州市| 东莞市| 龙胜| 五峰| 阳高县| 长子县| 宁武县| 碌曲县|