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

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

          導(dǎo)航

          統(tǒng)計

          留言簿(1)

          文章分類(141)

          文章檔案(147)

          搜索

          最新評論

          主站蜘蛛池模板: 张家港市| 崇义县| 隆林| 涪陵区| 厦门市| 兴仁县| 台北县| 安图县| 锡林浩特市| 长阳| 洛扎县| 易门县| 垦利县| 克东县| 伊宁县| 财经| 枣阳市| 广饶县| 射洪县| 余干县| 勃利县| 永德县| 河曲县| 青州市| 西畴县| 石景山区| 安阳县| 庆阳市| 大兴区| 云霄县| 长岛县| 元阳县| 大方县| 曲松县| 安西县| 大英县| 罗山县| 汤阴县| 洪洞县| 运城市| 巧家县|