于是谁告诉我怎么A页面点个按钮把A页面的一个值传给B页面阿。。。。。。。。。。。。。
//这个就是A页面的按钮
public String button1_action() {
//待办事项:执行此操作。返回值为某个导航
//情况名称;如果返回值为空,将返回至同一页面
int a = 5;//比如这个就是要传的变量
return "case1";
}
B页面
public void init() {
// Perform initializations inherited from our superclass
super.init();
// Perform application initialization that must complete
// *before* managed components are initialized
// TODO - add your own initialiation code here
//我要B页面一打开初始化的时候就把a值传过来所以代码应该是写在这个位置。
//int b;
//就是简单的把A页面的a赋值给b,该怎么做呢???????????????
// <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
// Initialize automatically managed components
// *Note* - this logic should NOT be modified
try {
_init();
} catch (Exception e) {
log("simplyresult Initialization Failure", e);
throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
}
// </editor-fold>
// Perform application initialization that must complete
// *after* managed components are initialized
// TODO - add your own initialization code here
}
我还是不太明白
//这个就是A页面的按钮
public String button1_action() {
//待办事项:执行此操作。返回值为某个导航
//情况名称;如果返回值为空,将返回至同一页面
int a = 5;//比如这个就是要传的变量
return "case1";
}
B页面
public void init() {
// Perform initializations inherited from our superclass
super.init();
// Perform application initialization that must complete
// *before* managed components are initialized
// TODO - add your own initialiation code here
//我要B页面一打开初始化的时候就把a值传过来所以代码应该是写在这个位置。
//int b;
//就是简单的把A页面的a赋值给b,该怎么做呢???????????????
// <editor-fold defaultstate="collapsed" desc="Managed Component Initialization">
// Initialize automatically managed components
// *Note* - this logic should NOT be modified
try {
_init();
} catch (Exception e) {
log("simplyresult Initialization Failure", e);
throw e instanceof FacesException ? (FacesException) e: new FacesException(e);
}
// </editor-fold>
// Perform application initialization that must complete
// *after* managed components are initialized
// TODO - add your own initialization code here
}