문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 다음 판 양쪽 다음 판 | ||
springframework:springboot:json [2018/11/30 11:49] kwon37xi |
springframework:springboot:json [2020/07/10 14:29] kwon37xi [WRITE_DATES_AS_TIMESTAMPS=false 사용] |
||
---|---|---|---|
줄 42: | 줄 42: | ||
spring.jackson.serialization.write-dates-as-timestamps: | spring.jackson.serialization.write-dates-as-timestamps: | ||
</ | </ | ||
- | * SpringBoot 2.x 는 이값이 **기본 '' | + | * SpringBoot 2.x 는 이값이 **기본 '' |
* 이렇게 하면 '' | * 이렇게 하면 '' | ||
{ | { | ||
줄 115: | 줄 115: | ||
}</ | }</ | ||
* '' | * '' | ||
+ | |||
+ | ==== Jackson2ObjectMapperBuilder 사용시 Module 추가 ==== | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
==== @EnableWebMvc ==== | ==== @EnableWebMvc ==== | ||
'' | '' | ||
줄 153: | 줄 158: | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
+ | |||
+ | ==== WebFlux Jackson 설정 ==== | ||
+ | * [[springframework: | ||
+ | * '' | ||
+ | * https:// | ||
+ | |||
+ | <code java> | ||
+ | @Configuration | ||
+ | public class Config implements WebFluxConfigurer, | ||
+ | @Override | ||
+ | public void customize(Jackson2ObjectMapperBuilder jacksonObjectMapperBuilder) { | ||
+ | jacksonObjectMapperBuilder | ||
+ | .featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) | ||
+ | .timeZone(TimeZone.getDefault()) | ||
+ | .locale(Locale.getDefault()) | ||
+ | .simpleDateFormat(" | ||
+ | } | ||
+ | } | ||
+ | </ | ||
==== 기타 참조 ==== | ==== 기타 참조 ==== | ||
줄 161: | 줄 185: | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
+ | * [[https:// |