I\'m using Spring MVC and Jackson for JSON de/serialization. But im facing a problem with serializing a date.
By default Jackson serialize a date as an epoch. But i
Much simpler way to do this now in Spring 3.1.
public class CustomObjectMapper extends ObjectMapper {
public CustomObjectMapper() {
configure(SerializationConfig.Feature.WRITE_DATES_AS_TIMESTAMPS, false);
setDateFormat(new ISO8601DateFormat());
}
}
And then register this as a bean and customize the mvc:annotation-driven element.