loading table of contents...

Content Application Developer Manual / Version 2310

Table Of Contents

In order to validate a form, an org.springframework.validation.Validator can be implemented for arbitrary form backing beans. The validation method populates an org.springframework.validation.Errors object with error messages, see MyFormValidator Example for a complete example.

if(form.getEmail() == null) {
        "The email address is missing."

The first argument passed to Errors#rejectValue() denotes the form bean property (here: “email”) that is invalid. The following arguments are an error code (to be defined in a resource bundle) and a default message.

Global errors affecting the entire form instead of a single property are supported, too.

Search Results

Table Of Contents

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.