更新时间:2022-01-12 18:24:39
将该组件绑定为 UIInput#getValue()
将其值作为方法参数传递.
Bind the component as UIInput
to the view and use UIInput#getValue()
to pass its value as method argument.
<h:inputText binding="#{input1}" />
<h:commandButton value="Test" action="#{myBean.execute(input1.value)}" />
使用
public void execute(String value) {
// ...
}
请注意,该值已经通过这种方式转换并验证了通常的JSF方式.
Note that the value is this way already converted and validated the usual JSF way.