...
Likewise, a form control could be populated by calling a JavaBean accessor, like getPostalCode
. In the expression language, we can refer to the JavaBean property by name. An expression like "%{postalCode}" would in turn call getPostalCode
.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<@s.form action="updateAddress"> <@s.textfield label="Postal Code" name="postalCode" value="%{postalCode}"/> ... </@s.form> |
However, since the tags imply a relationship between the name
and value
, the value
attribute is optional. If a value
is not specified, by default, the JavaBean accessor is used instead.
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<@s.form action="updateAddress"> <@s.textfield label="Postal Code" name="postalCode"/> ... </@s.form> |
...