I need to pass a parameter (POST) to a @managedBean, I used managed properties like this:
@ManagedProperty(value = "#{param.id}")
private int id;
And the scope of the Bean is ViewScope
I end up with this error:
Unable to create managed bean receipt. The following problems were found: - The scope of the object referenced by expression #{param.id}, request, is shorter than the referring managed beans scope of view
What can I do?
arjan take a look:
My page:
Facelet Title
<form method="post" action="faces/index.xhtml">
<input name="id" value="4" />
<input type="submit" value="submit" />
</form>
<h:form>
<h:commandLink value="click" action="index">
<f:param id="id" name="id" value="20"/>
</h:commandLink>
</h:form>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…