Before going on, see this question
It's JSF form is shown again as follows:
<f:view>
<h:form>
<div>
<label>Id</label>
<input type="text" name="accountId"/>
</div>
<div>
<label>Amount</label>
<input type="text" name="amount"/>
</div>
<h:commandButton value="Withdraw" action="#{accountService.withdraw(param.accountId, param.amount)}"/>
</h:form>
</f:view>
Notice that I have used <input type="text" name="amount">
instead of <h:inputText id="amount">
. In order to retrieve its value by using Seam EL resolver, I use param.amount
.
It happens that if I use <input type="text"
and something goes wrong on server side, I need to show the page again. So its submitted value is not retrieved because it is a plain html code. Because of that, I need to use a <h:inputText
JSF component instead.
So the question is: How do I retrieve a <h:inputText
JSF component value by using Expression Language?