Springmvc responsebody 返回对象属性 是date日期格式时 如何返回给前台自己想要的形式
1添加依赖
<!-- Jackson Json处理工具包 -->
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-mapper-asl</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.core.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.core.version}</version>
</dependency>
<properties> <jackson.version>1.9.13</jackson.version> <jackson.core.version>2.4.2</jackson.core.version> </properties>
2.在实体类的getter方法上面添加@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")