Witam próbuje umożliwić obsługę częściej stosowanego formatu daty zgodnego z ustawieniami regionalnymi za pomocą klasy Formatter<LocalDate>. Gdy wpisuje datę np 01-09-1994 w konsoli dostaje
Field error in object 'profileForm' on field 'birthDate': rejected value [01-09-1994]; codes [typeMismatch.profileForm.birthDate,typeMismatch.birthDate,typeMismatch.java.util.Date,typeMismatch]; arguments [org.springframework.context.support.DefaultMessageSourceResolvable: codes [profileForm.birthDate,birthDate]; arguments []; default message [birthDate]]; default message [Failed to convert property value of type 'java.lang.String' to required type 'java.util.Date' for property 'birthDate'; nested exception is org.springframework.core.convert.ConversionFailedException: Failed to convert from type [java.lang.String] to type [java.util.Date] for value '01-09-1994'; nested exception is java.lang.IllegalArgumentException]
a w przeglądarce
Validation failed for object='profileForm'. Error count: 1
Github https://github.com/Baron762/Social