我遇到这种情况:
我的模特
public class Model {
int id;
String desc;
}
带有请求范围的托管bean
@Request
@ManagedBean(name = "bean")
public class ModelMB {
Model model; // with getter/setter
public void action(){
dao.persistWithRefresh(model);
return sucess;
}
}
和我的带有导航案例的facesconfig
faces-config.xml中
<navigation-rule>
<from-view-id>/nutri/signin.xhtml</from-view-id>
<navigation-case>
<from-outcome>sucess</from-outcome>
<to-view-id>/nutri/show.xhtml</to-view-id>
<redirect include-view-params="true">
<view-param>
<name>id</name>
<value>#{bean.model.id}</value>
</view-param>
</redirect>
</navigation-case>
</navigation-rule>
但是在提交后的页面show.xhtml id param是空的..为什么? ;(