DTO를 통해 Localdate 받아 post 하면 에러
Closed this issue · 0 comments
childForm 엔티티에서 localDate 데이터(birth)를 받아 업데이트 할 때 에러가 발생한다.
[에러 메세지]
org.springframework.validation.BeanPropertyBindingResult: 1 errors
Field error in object 'childForm' on field 'birth': rejected value [2021-08-18]; codes [typeMismatch.childForm.birth,typeMismatch.birth,typeMismatch.java.time.LocalDate,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [childForm.birth,birth]; arguments []; default message [birth]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'java.time.LocalDate' for property 'birth'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [java.time.LocalDate] for value '2021-08-18'; nested exception is java.lang.IllegalArgumentException: Parse attempt failed for value [2021-08-18]]