You probably used @ManagedProperty . This is not applicable in the scope of the bean for setting the request parameter, since the view scope has a wider scope than the request scope.
The canonical JSF2 way to pass request parameters and call actions on them will look something like this:
view.xhtml :
<h:link value="Edit" outcome="edit"> <f:param name="id" value="#{item.id}" /> </h:link>
edit.xhtml :
<f:metadata> <f:viewParam name="id" value="#{edit.id}" /> <f:event type="preRenderView" listener="#{edit.init}" /> </f:metadata>
Edit bean support:
@ManagedBean @ViewScoped public class Edit { private Long id; public void init() {
See also:
source share