Overview | Package | Class | Tree | Deprecated | Index | Help
| Spring Framework
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.springframework.web.bind
Class MethodArgumentNotValidException

    java.lang.Object
      java.lang.Throwable
          java.lang.Exception
              org.springframework.web.bind.MethodArgumentNotValidException

All Implemented Interfaces:
  java.io.Serializable

    public class MethodArgumentNotValidException

extends java.lang.Exception

Exception to be thrown when validation on an argument annotated with `@Valid` fails.

Since:
  3.1
Author:
  Rossen Stoyanchev
See Also:
  Serialized Form

Constructor Summary
`MethodArgumentNotValidException(MethodParameter parameter, BindingResult bindingResult)` Constructor for `MethodArgumentNotValidException`.

Method Summary
`BindingResult` | `getBindingResult()` Return the results of the failed validation.
`java.lang.String` | `getMessage()`
`MethodParameter` | `getParameter()` Return the method parameter that failed validation.

Methods inherited from class java.lang.Throwable
`fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### MethodArgumentNotValidException

    public MethodArgumentNotValidException(MethodParameter parameter,
                                           BindingResult bindingResult)

  Constructor for `MethodArgumentNotValidException`.

  Parameters:
    `parameter` - the parameter that failed validation
    `bindingResult` - the results of the validation

Method Detail

### getParameter

    public MethodParameter getParameter()

  Return the method parameter that failed validation.

### getBindingResult

    public BindingResult getBindingResult()

  Return the results of the failed validation.

### getMessage

    public java.lang.String getMessage()

  Overrides:
    `getMessage` in class `java.lang.Throwable`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Spring Framework
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD