I have a date DTO:
public class SampleDTO{
Date date;
//setter, getter, constructor
}
In Spring MVC, I make it in ModelAttribute and sent:
@ModelAttribute("sample")
public SampleDTO getSample() {
return new SampleDTO(new Date());
}
However, In web page, it shows in following date format:
Thu Aug 31 00:00:00 CEST 2017
Anyone know how to change the date format?
PS: No any change in front-end, no use JSTL, no use tag. I only want to make some change in MappingJackson2HttpMessageConverter
You can config configure message converters in your configuration file: