我正在使用Spring Boot和属性占位符。我有一个属性文件,其值为:date.A=24/07/17
。 我有一个类和我使用的@Value
注释:LocalDate with Property place holder Spring
Caused by: java.time.format.DateTimeParseException: Text '24/07/17' could not be parsed: Invalid value for MonthOfYear (valid values 1 - 12): 24
at java.time.format.DateTimeFormatter.createError(DateTimeFormatter.java:1920)
at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1855)
at java.time.LocalDate.parse(LocalDate.java:400)
改变它之后是工作,但根据业务我想DD/MM/YY –