Tapestry中頁面之間的數據傳遞方法

          不同于jsp。使用getter,setter方法,在老的頁面中setter參數,在新的頁面中getter參數
          例子:

          public class Home extends BasePage {
          private String stockId;
          ...
          public IPage onOk(IRequestCycle cycle) {
          int stockValue = stockId.hashCode() % 100;
          Result resultPage = (Result) cycle.getPage("Result");
          resultPage.setStockValue(stockValue);
          return resultPage;
          }
          }


          public class Result extends BasePage {
          int stockValue;
          public int getStockValue() {
          return 100stockValue;
          }
          public void setStockValue(int stockValue) {
          this.stockValue = stockValue;
          }
          }


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

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

          導航

          統計

          留言簿(1)

          文章分類(141)

          文章檔案(147)

          搜索

          最新評論

          主站蜘蛛池模板: 浮山县| 平安县| 泰顺县| 深水埗区| 鹤壁市| 金华市| 浑源县| 永德县| 建宁县| 徐水县| 泰和县| 汨罗市| 长阳| 张家港市| 连江县| 海安县| 休宁县| 汨罗市| 泉州市| 西城区| 阿克陶县| 临高县| 墨竹工卡县| 伽师县| 泾阳县| 南漳县| 锦州市| 万载县| 泽州县| 余庆县| 汝阳县| 礼泉县| 陆河县| 稷山县| 霞浦县| 息烽县| 宜君县| 定州市| 平潭县| 长汀县| 磐石市|