|
@@ -491,18 +491,18 @@ In this handler we need to do the following:
|
491
|
491
|
|
492
|
492
|
```java
|
493
|
493
|
List<FieldError> fieldErrors = manve.getBindingResult().getFieldErrors();
|
494
|
|
- for(FieldError fe : fieldErrors) {
|
495
|
|
-
|
496
|
|
- List<ValidationError> validationErrorList = errorDetail.getErrors().get(fe.getField());
|
497
|
|
- if(validationErrorList == null) {
|
498
|
|
- validationErrorList = new ArrayList<>();
|
499
|
|
- errorDetail.getErrors().put(fe.getField(), validationErrorList);
|
500
|
|
- }
|
501
|
|
- ValidationError validationError = new ValidationError();
|
502
|
|
- validationError.setCode(fe.getCode());
|
503
|
|
- validationError.setMessage(messageSource.getMessage(fe, null));
|
504
|
|
- validationErrorList.add(validationError);
|
505
|
|
- }
|
|
494
|
+for(FieldError fe : fieldErrors) {
|
|
495
|
+
|
|
496
|
+ List<ValidationError> validationErrorList = errorDetail.getErrors().get(fe.getField());
|
|
497
|
+ if(validationErrorList == null) {
|
|
498
|
+ validationErrorList = new ArrayList<>();
|
|
499
|
+ errorDetail.getErrors().put(fe.getField(), validationErrorList);
|
|
500
|
+ }
|
|
501
|
+ ValidationError validationError = new ValidationError();
|
|
502
|
+ validationError.setCode(fe.getCode());
|
|
503
|
+ validationError.setMessage(messageSource.getMessage(fe, null));
|
|
504
|
+ validationErrorList.add(validationError);
|
|
505
|
+}
|
506
|
506
|
```
|
507
|
507
|
|
508
|
508
|
## Part 5.7 - Externalize strings in a messages.properties file
|