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

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

          導航

          統計

          留言簿(1)

          文章分類(141)

          文章檔案(147)

          搜索

          最新評論

          主站蜘蛛池模板: 克什克腾旗| 汤原县| 万山特区| 西吉县| 奉新县| 金昌市| 翁牛特旗| 宜春市| 清远市| 鄢陵县| 三门峡市| 竹山县| 九江市| 临猗县| 石首市| 大宁县| 临夏县| 轮台县| 西充县| 黄石市| 阿克| 深圳市| 永安市| 嘉禾县| 奉贤区| 镇平县| 麟游县| 通州区| 枝江市| 宜州市| 达尔| 襄垣县| 屏东市| 邢台市| 西丰县| 章丘市| 云梦县| 喀喇沁旗| 沙河市| 荆州市| 新巴尔虎左旗|