Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

To enable the user to edit his information that is stored in the Person object, we have this form:

Image RemovedImage Added

When the user submits the form, we want to validate his entries into the form fields.

...

For example if the user doesn't enter a value in the first name form field and clicks on the Save Changes button, he will see the following.

Image RemovedImage Added

Validating An Email Address

...

If the user did not check any of the check boxes, the Array returned by the getCarModels method will have a length value of 0. Since the complete OGNL expression will only evaluate to true if the length value is greater than 0, the validation fails. The user will see this.

Image RemovedImage Added

The fieldexpression validator is useful when doing conditional validation of a user's input. If the OGNL expression doesn't evaluate to true then the user's input won't be allowed.

...