The command button does not do that. The command button only determines for itself if an action has to be invoked and if so, which method it is. Each of the input components sets their own value. The actual job is done in the decode()
method of the Renderer
associated with the component. During the apply request values phase, JSF walks through all UIForm
, UIInput
and UICommand
components. Each of them first gets the request parameter value by own client ID as request parameter name:
String value = request.getParameter(input.getClientId(context));
(the request
is here HttpServletRequest
and input
is here UIInput
)
Then, after a process of conversion and validation where necessary, it get ultimately set as bean property referenced by its own value
attribute.
input.getValueExpression("value").setValue(context.getElContext(), value);
The ValueExpression#setValue()
will evaluate the #{userBean.age}
, auto-create the bean if it doesn't exist in the scope yet and then invoke the setAge()
method on it with the passed-in value.
This is all in detail described in the JSF specification.