[摘录]Spring MVC Jackson DateFormat

使用Spring MVC 里的Jackson返回JSON时,遇到日期默认是格式化成timestamp,在Google搜索解决方法都是在get方法添加annotation
问题:项目全部的Date类型都要添加?  显然是不可能的!  搜索到的解决方法

查看 Jackson文档中发现可以统一设置DateFormat


所以修改servlet-context.xml:
[摘录]Spring MVC Jackson DateFormat_第1张图片 



http://jackson.codehaus.org/
http://wiki.fasterxml.com/JacksonFAQDateHandling

你可能感兴趣的:([摘录]Spring MVC Jackson DateFormat)