문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 양쪽 이전 판 이전 판 다음 판 | 이전 판 | ||
|
springframework:springboot:mvc [2018/07/20 11:26] kwon37xi |
springframework:springboot:mvc [2020/07/17 10:21] (현재) kwon37xi [Converter] |
||
|---|---|---|---|
| 줄 1: | 줄 1: | ||
| - | ====== SpringBoot and Spring MVC ====== | + | ====== SpringBoot and Spring |
| ===== 설정 커스터마이즈 ===== | ===== 설정 커스터마이즈 ===== | ||
| * [[https:// | * [[https:// | ||
| 줄 7: | 줄 7: | ||
| * '' | * '' | ||
| * 이 경우 '' | * 이 경우 '' | ||
| + | * 즉, SpringBoot 에서는 '' | ||
| + | |||
| + | ===== @WebMvcTest 가 잘되게 하려면 ===== | ||
| + | * [[springframework: | ||
| + | * 따라서 WebMvc 관련 설정(특히 '' | ||
| ===== Formatter ===== | ===== Formatter ===== | ||
| 줄 13: | 줄 18: | ||
| * 날짜의 경우 '' | * 날짜의 경우 '' | ||
| * [[https:// | * [[https:// | ||
| - | ===== Converter ===== | + | * 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 ===== | ||
| + | * [[springframework: | ||