I have a class with a java.util.Date field that I wish to pass from a client to a Spring controller. The controller returns HTTP 415 whenever I make the request. I have trie
You have a serializer, but no deserializer, so it's only working one way...
You also need:
@JsonDeserialize(using = DateDeserializer.class)
(with a DateDeserializer using the same date format).
Why there isn't a single interface for both is a mystery to me :-)
Instead of string, just pass date object from jsp as below.
var date = new Date();
var formData = {'date':date};
And in the dto, make variable of type java.util.Date.