浏览代码

Update README.md

Git-Leon 7 年前
父节点
当前提交
b9326aed69
共有 1 个文件被更改,包括 12 次插入12 次删除
  1. 12
    12
      README.md

+ 12
- 12
README.md 查看文件

@@ -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