Tapestry中頁面之間的數(shù)據(jù)傳遞方法

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

          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) 評(píng)論(0)  編輯  收藏 所屬分類: Tapestry

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

          導(dǎo)航

          統(tǒng)計(jì)

          留言簿(1)

          文章分類(141)

          文章檔案(147)

          搜索

          最新評(píng)論

          主站蜘蛛池模板: 兴宁市| 随州市| 五原县| 镇沅| 镇原县| 五河县| 教育| 镇江市| 岑巩县| 霍州市| 绍兴县| 冷水江市| 巍山| 驻马店市| 白城市| 海盐县| 仙游县| 南召县| 开远市| 城口县| 巨野县| 怀化市| 通榆县| 武清区| 淳安县| 海林市| 日照市| 仙居县| 全椒县| 定兴县| 华宁县| 商城县| 德州市| 周至县| 梓潼县| 景东| 黎川县| 从化市| 双柏县| 白河县| 阿克苏市|