Spring Boot 1.4 Release returns 数组中的 LocalDateTime 序列化
LocalDateTime Serialization in Spring Boot 1.4 Release returns array
最近我更新了我的项目以使用 Spring Boot 1.4-Release,但是,LocalDateTime
的序列化似乎被破坏了。
以下为pom.xml
...
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version>
</parent>
...
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
....
和Jackson配置在application.properties
spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false
LocalDateTime
对象被格式化为数组,类似于 [2016, 8, 17, 11, 50, 0]
,而不是 "2016-08-17T11:50:00"
这是我在使用 Spring Boot 1.4.RC1
时得到的
但是,LocalDate
仍然可以正确解释为"2016-08-17"
。
有人能帮忙吗?非常感激!!
谢谢大家!这其实是我的错......为了减少网络流量时间,结果在传输前被序列化然后压缩,但是我忘记在手动创建的ObjectMapper中将WRITE_DATES_AS_TIMES TAMPS特性设置为false
最近我更新了我的项目以使用 Spring Boot 1.4-Release,但是,LocalDateTime
的序列化似乎被破坏了。
以下为pom.xml
...
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.0.RELEASE</version>
</parent>
...
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
....
和Jackson配置在application.properties
spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false
LocalDateTime
对象被格式化为数组,类似于 [2016, 8, 17, 11, 50, 0]
,而不是 "2016-08-17T11:50:00"
这是我在使用 Spring Boot 1.4.RC1
但是,LocalDate
仍然可以正确解释为"2016-08-17"
。
有人能帮忙吗?非常感激!!
谢谢大家!这其实是我的错......为了减少网络流量时间,结果在传输前被序列化然后压缩,但是我忘记在手动创建的ObjectMapper中将WRITE_DATES_AS_TIMES TAMPS特性设置为false