문서의 선택한 두 판 사이의 차이를 보여줍니다.
양쪽 이전 판 이전 판 다음 판 | 이전 판 다음 판 양쪽 다음 판 | ||
springframework:springboot:mvc [2018/11/27 15:21] kwon37xi [Formatter] |
springframework:springboot:mvc [2020/07/09 15:08] kwon37xi [설정 커스터마이즈] |
||
---|---|---|---|
줄 7: | 줄 7: | ||
* '' | * '' | ||
* 이 경우 '' | * 이 경우 '' | ||
+ | * 즉, SpringBoot 에서는 '' | ||
+ | |||
+ | ===== @WebMvcTest 가 잘되게 하려면 ===== | ||
+ | * [[springframework: | ||
+ | * 따라서 WebMvc 관련 설정(특히 '' | ||
===== Formatter ===== | ===== Formatter ===== | ||
줄 14: | 줄 19: | ||
* [[https:// | * [[https:// | ||
* Formatter와 Jackson Serializers/ | * Formatter와 Jackson Serializers/ | ||
+ | |||
+ | ==== Java 8 java.time.* Formatter 일괄 등록 ==== | ||
+ | * from https:// | ||
+ | * 아래 설정은 Java 8 '' | ||
+ | |||
+ | <code java> | ||
+ | @Configuration | ||
+ | public class MyApiWebMvcConfig | ||
+ | |||
+ | @Override | ||
+ | public void addFormatters(FormatterRegistry registry) { | ||
+ | DateTimeFormatterRegistrar dateTimeFormatterRegistrar = new DateTimeFormatterRegistrar(); | ||
+ | dateTimeFormatterRegistrar.setUseIsoFormat(true); | ||
+ | dateTimeFormatterRegistrar.registerFormatters(registry); | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
===== Converter ===== | ===== Converter ===== | ||