java.lang.Object | |
↳ | org.springframework.validation.DefaultBindingErrorProcessor |
Default BindingErrorProcessor
implementation.
Uses the "required" error code and the field name to resolve message codes for a missing field error.
Creates a FieldError
for each PropertyAccessException
given, using the PropertyAccessException
's error code ("typeMismatch",
"methodInvocation") for resolving message codes.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | MISSING_FIELD_ERROR_CODE | Error code that a missing field error (i.e. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Apply the missing field error to the given BindException.
| |||||||||||
Translate the given
PropertyAccessException to an appropriate
error registered on the given Errors instance. |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return FieldError arguments for a binding error on the given field.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.validation.BindingErrorProcessor
|
Error code that a missing field error (i.e. a required field not found in the list of property values) will be registered with: "required".
Apply the missing field error to the given BindException.
Usually, a field error is created for a missing required field.
missingField | the field that was missing during binding |
---|---|
bindingResult | the errors object to add the error(s) to.
You can add more than just one error or maybe even ignore it.
The BindingResult object features convenience utils such as
a resolveMessageCodes method to resolve an error code. |
Translate the given PropertyAccessException
to an appropriate
error registered on the given Errors
instance.
Note that two error types are available: FieldError
and
ObjectError
. Usually, field errors are created, but in certain
situations one might want to create a global ObjectError
instead.
ex | the PropertyAccessException to translate |
---|---|
bindingResult | the errors object to add the error(s) to.
You can add more than just one error or maybe even ignore it.
The BindingResult object features convenience utils such as
a resolveMessageCodes method to resolve an error code. |
Return FieldError arguments for a binding error on the given field. Invoked for each missing required field and each type mismatch.
The default implementation returns a single argument indicating the field name (of type DefaultMessageSourceResolvable, with "objectName.field" and "field" as codes).
objectName | the name of the target object |
---|---|
field | the field that caused the binding error |