@Valid fails.
Extends BindException as of 5.3.
| Modifier and Type | Field and Description |
|---|---|
| private final ProblemDetail | |
| private final MethodParameter |
| Access | Constructor and Description |
|---|---|
| public | MethodArgumentNotValidException(MethodParameter
the parameter that failed validation parameter, BindingResult the results of the validation bindingResult)Constructor for |
| Modifier and Type | Method and Description |
|---|---|
| public static List | errorsToStringList(List<? extends ObjectError> errors)
Deprecated
for removal since 6.1. in favor of using
BindErrorUtils and
getAllErrors(), to be removed in 6.2
Convert each given |
| public static List | errorsToStringList(List<? extends ObjectError> errors, MessageSource messageSource, Locale locale)
Deprecated
for removal since 6.1. in favor of
BindErrorUtils, to be removed in 6.2
Convert each given |
| public ProblemDetail | getBody()
Implements org. Return the body for the response, formatted as an RFC 7807
|
| public Object[] | getDetailMessageArguments(MessageSource
the source, Locale MessageSource to use for the lookupthe locale)Locale to use for the lookupOverrides default org. Variant of |
| public Object[] | getDetailMessageArguments()
Overrides default org. Return arguments to use along with a |
| public String | getMessage()
Overrides org. Returns diagnostic information about the errors held in this object. |
| public final MethodParameter | |
| public HttpStatusCode | getStatusCode()
Implements org. Return the HTTP status code to use for the response. |
| public Map | Returns: a Map with errors as keys and resolved messages as values
Deprecated
for removal since 6.1. in favor of using
BindErrorUtils and
getAllErrors(), to be removed in 6.2
Resolve global and field errors to messages with the given
|
| body | back to summary |
|---|---|
| private final ProblemDetail body | |
| parameter | back to summary |
|---|---|
| private final MethodParameter parameter | |
| MethodArgumentNotValidException | back to summary |
|---|---|
| public MethodArgumentNotValidException(MethodParameter parameter, BindingResult bindingResult) Constructor for
| |
| errorsToStringList | back to summary |
|---|---|
| public static List Deprecated for removal since 6.1. in favor of using Convert each given
| |
| errorsToStringList | back to summary |
|---|---|
| public static List Convert each given
| |
| getBody | back to summary |
|---|---|
| public ProblemDetail getBody() Implements org. Doc from org. Return the body for the response, formatted as an RFC 7807
| |
| getDetailMessageArguments | back to summary |
|---|---|
| public Object[] getDetailMessageArguments(MessageSource source, Locale locale) Overrides default org. Doc from org. Variant of This is useful for example to expand message codes from validation errors. The default implementation delegates to
| |
| getDetailMessageArguments | back to summary |
|---|---|
| public Object[] getDetailMessageArguments() Overrides default org. Doc from org. Return arguments to use along with a
| |
| getMessage | back to summary |
|---|---|
| public String getMessage() Overrides org. Doc from org. Returns diagnostic information about the errors held in this object.
| |
| getParameter | back to summary |
|---|---|
| public final MethodParameter getParameter() Return the method parameter that failed validation. | |
| getStatusCode | back to summary |
|---|---|
| public HttpStatusCode getStatusCode() Implements org. Doc from org. Return the HTTP status code to use for the response.
| |
| resolveErrorMessages | back to summary |
|---|---|
| public Map Deprecated for removal since 6.1. in favor of using Resolve global and field errors to messages with the given
| |