@Override
public void configureMessageConverters(
List<HttpMessageConverter<?>> converters) {
// Configure JSON support
MappingJacksonHttpMessageConverter mappingJacksonHttpMessageConverter = new MappingJacksonHttpMessageConverter();
mappingJacksonHttpMessageConverter.setSupportedMediaTypes(Arrays
.asList(MediaType.APPLICATION_JSON));
mappingJacksonHttpMessageConverter.getObjectMapper().configure(
Feature.WRITE_DATES_AS_TIMESTAMPS, true);
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
// There is no need to set the timezone as Jackson uses GMT and not the
// local time zone (which is exactly what you want)
// Note: While SimpleDateFormat is not threadsafe, Jackson Marshaller's
// StdSerializerProvider clones the configured formatter for each thread
mappingJacksonHttpMessageConverter.getObjectMapper().setDateFormat(
format);
mappingJacksonHttpMessageConverter.getObjectMapper().configure(
Feature.INDENT_OUTPUT, true);
// mappingJacksonHttpMessageConverter.getObjectMapper().getSerializationConfig().setSerializationInclusion(Inclusion.NON_NULL);
converters.add(mappingJacksonHttpMessageConverter);
}