我正在使用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 –