List of usage examples for org.springframework.http.converter.json Jackson2ObjectMapperFactoryBean setDateFormat
public void setDateFormat(DateFormat dateFormat)
From source file:io.getlime.push.configuration.WebApplicationConfig.java
/** * Custom object mapper to make sure that dates and other values serialize * correctly./* www . jav a2 s . com*/ * * @return A new object mapper. */ private ObjectMapper objectMapper() { Jackson2ObjectMapperFactoryBean bean = new Jackson2ObjectMapperFactoryBean(); bean.setIndentOutput(true); bean.setDateFormat(new ISO8601DateFormat()); bean.afterPropertiesSet(); ObjectMapper objectMapper = bean.getObject(); objectMapper.registerModule(new JodaModule()); return objectMapper; }