abstract class BindingResultUtils
Convenience methods for looking up BindingResults in a model Map. |
|
open class DefaultBindingErrorProcessor : BindingErrorProcessor
Default BindingErrorProcessor implementation. Uses the "required" error code and the field name to resolve message codes for a missing field error. Creates a |
|
open class DefaultMessageCodesResolver : MessageCodesResolver, Serializable
Default implementation of the MessageCodesResolver interface. Will create two message codes for an object error, in the following order (when using the
Will create four message codes for a field specification, in the following order:
For example, in case of code "typeMismatch", object name "user", field "age":
This resolution algorithm thus can be leveraged for example to show specific messages for binding errors like "required" and "typeMismatch":
In case of array, List or java.util.Map properties, both codes for specific elements and for the whole collection are generated. Assuming a field "name" of an array "groups" in object "user":
By default the In order to group all codes into a specific category within your resource bundles, e.g. "validation.typeMismatch.name" instead of the default "typeMismatch.name", consider specifying a |
|
open class DirectFieldBindingResult : AbstractPropertyBindingResult
Special implementation of the Errors and BindingResult interfaces, supporting registration and evaluation of binding errors on value objects. Performs direct field access instead of going through JavaBean getters. Since Spring 4.1 this implementation is able to traverse nested fields. |
|
open class MapBindingResult : AbstractBindingResult, Serializable
Map-based implementation of the BindingResult interface, supporting registration and evaluation of binding errors on Map attributes. Can be used as errors holder for custom binding onto a Map, for example when invoking a Validator for a Map object. |
|
open class ObjectError : DefaultMessageSourceResolvable
Encapsulates an object error, that is, a global reason for rejecting an object. See the DefaultMessageCodesResolver javadoc for details on how a message code list is built for an |
|
abstract class ValidationUtils
Utility class offering convenient methods for invoking a Validator and for rejecting empty fields. Checks for an empty field in |
open class BindException : Exception, BindingResult
Thrown when binding errors are considered fatal. Implements the BindingResult interface (and its super-interface Errors) to allow for the direct analysis of binding errors. As of Spring 2.0, this is a special-purpose class. Normally, application code will work with the BindingResult interface, or with a DataBinder that in turn exposes a BindingResult via |