不同于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;
}
}