Java Reference
In-Depth Information
JSF validation
Earlier in this chapter we discussed how the required attribute for JSF input fields
allows us to easily make input fields mandatory.
If a user attempts to submit a form with one or more required fields missing, an error
message is automatically generated.
The error message is generated by the <h:message> tag corresponding to the invalid
field. The string "First Name" in the error message corresponds to the value of the
label attribute for the field, had we omitted the label attribute, the value of the field's
id attribute would have been shown instead. As we can see, the required attribute
makes it very easy to implement mandatory field functionality in our application.
Search WWH ::

Custom Search