Getting value of invalid field after MethodArgumentNotValidException
<p>My entity class is annotated with <code>@NotNull</code> of hibernate for one of the field.I am catching the exception in <code>@ExceptionHelper</code>. My problem is that i want to access the value of the invalid field so that i can add it into the logger.</p>

<p>Here is the <code>ExceptionHandler</code>:</p>

<pre><code>@ExceptionHandler({ MethodArgumentNotValidException .class })
@ResponseBody
public ResponseEntity&lt;?&gt; handleInvalidMethodArgException(MethodArgumentNotValidException  de) {
    List&lt;FieldError&gt; bindingResult = de.getBindingResult().getFieldErrors();
    LOGGER.debug(String.format("Start : %s : handleDataexception()", this
                .getClass().getSimpleName()));

    for(FieldError fieldError: bindingResult){
        LOGGER.debug("Invalid {} value submitted for {}", 
                            fieldError.getRejectedValue(), fieldError.getField());
    }

    ErrorMsg = new ErrorMsg(errorCode, errorMessage);
    return new ResponseEntity&lt;&gt;(errMsg, HttpStatus.NOT_FOUND);
}
</code></pre>

<p>I have added <code>@Validated</code> with the <code>@RequestBody</code> in the controller.</p>