spring mvc 4: parse String to java.time.LocalDate using property format annotation

252 Views Asked by At

In a DTO, I can get a date string converted to a java.util.Date, using the com.fasterxml.jackson.annotation.JsonFormat annotation:

class myDTO {
     @JsonFormat(pattern="MM/dd/yyyy")
     private Date theDate;
     // accessors, etc...
}

Not so when the property is of type java.util.LocalDate...

How do I make it work?

Using jackson-databind-2.4.1

Thanks!

0

There are 0 best solutions below