Use <f:param>
in the command link/button and use @ManagedProperty
or <f:viewParam>
in the target bean or view.
E.g.
<h:commandButton value="Submit" action="#{otherBean.submit}">
<f:param name="foo" value="#{oneBean.foo}" />
</h:commandButton>
with in OtherBean
@ManagedProperty("#{param.foo}")
private String foo;
// ...
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…