I am trying to upgrade spring-boot 2.1.4 to 2.1.5.
In spring-boot 2.1.4, custom validation error message with {0} arguments correctly replace with Field Name. But spring-boot 2.1.5, validation error message shows {0} as it is.
code
- messages.properties
notblank={0} must not be blank
- PersonForm
import javax.validation.constraints.NotBlank;
class PersonForm {
@NotBlank(message = "{notblank}")
private String name;
public String getName() {
return this.name;
}
public void setName(String name) {
this.name = name;
}
public String toString() {
return "Person(Name: " + this.name + ")";
}
}
Here's my sample project.
https://github.com/spikefin-goby/spring-boot-validation-sample
spring-boot 2.1.4 result
In spring-boot 2.1.4, display 「name must not be blank」
(correctly replace {0} with Field Name )
spring-boot 2.1.4 validation message
BingingResult.errors[0] is FieldError class
spring-boot 2.1.5 result
But spring-boot 2.1.5, display 「{0} must not be blank」
spring-boot 2.1.5 validation message
BingingResult.errors[0] is LocalValidatorFactoryBean class
What can I do about this?
Update
Spring Boot 2.1.6 has been released in June 19, 2019. This problem is fixed!
In spring-boot 2.1.6, display 「name must not be blank」
(correctly replace {0} with Field Name )