如果没有对日期时间对象类进行json日期格式声明,会出现类似"2014-05-06T16:09:33"日期,在日期中间多出一个T字母;
添加返回类型:
<result name="pointEstimate" type="json">
<param name="ignoreHierarchy">true</param>
<param name="excludeNullProperties">true</param>
<param name="includeProperties">pager.*,pointId</param>
<!-- <param name="excludeProperties">pager\[\d+\]\.resultList\[\d+\]\.zsuser,pager\[\d+\]\.resultList\[\d+\]\.zspoint</param>
-->
</result>
解决办法:在实体中get方法的上方进行json格式声明:
@JSON(format="yyyy-MM-dd HH:mm")
public Timestamp getEstime() {
return estime;
}
本文介绍在使用JSON格式化日期时,如何避免日期中间出现字母T的问题,并提供了解决方案,即通过在实体类中对get方法添加注解来指定日期时间的格式。
1355

被折叠的 条评论
为什么被折叠?



