사용자 도구

사이트 도구


springframework:springboot:mvc

차이

문서의 선택한 두 판 사이의 차이를 보여줍니다.

차이 보기로 링크

양쪽 이전 판 이전 판
다음 판
이전 판
다음 판 양쪽 다음 판
springframework:springboot:mvc [2018/07/20 11:23]
kwon37xi [Formatter]
springframework:springboot:mvc [2018/11/27 15:21]
kwon37xi [Formatter]
줄 9: 줄 9:
  
 ===== Formatter ===== ===== Formatter =====
-  * Controller 파라미터로 들어온 문자열을 객체로 변환해주는 전역 설정.+  * Controller 파라미터로 들어온 **문자열을 객체로 변환**해주는 전역 설정
 +  * [[https://docs.spring.io/spring/docs/5.0.x/javadoc-api/org/springframework/format/Formatter.html|Formatter]] 인터페이스 구현. ''Formatter''의 상속 클래스들도 모두 살펴볼 것.
   * 날짜의 경우 ''@DateTimeFormat'' 애노테이션으로 모든 파라미터마다 설정해주는 것도 가능하지만 공통 전역 설정으로 ''Date'', ''LocalDate'', ''LocalDateTime'' 을 만들어두는게 좋음.   * 날짜의 경우 ''@DateTimeFormat'' 애노테이션으로 모든 파라미터마다 설정해주는 것도 가능하지만 공통 전역 설정으로 ''Date'', ''LocalDate'', ''LocalDateTime'' 을 만들어두는게 좋음.
-  * [[https://docs.spring.io/spring/docs/5.0.x/javadoc-api/org/springframework/web/servlet/config/annotation/WebMvcConfigurer.html|WebMvcConfigurer]] 로 등록.+  * [[https://docs.spring.io/spring/docs/5.0.x/javadoc-api/org/springframework/web/servlet/config/annotation/WebMvcConfigurer.html|WebMvcConfigurer]] ''addFormatters''로 등록. 
 +  * Formatter와 Jackson Serializers/Deserializers 에 대해서 테스트를 만들어 보증하는 것이 좋다. [[https://gist.github.com/kwon37xi/aa359e364b7e81f79085fb04cc710037|FormatterSerializerTestControllerTest.groovy]]
 ===== Converter ===== ===== Converter =====
  
  
springframework/springboot/mvc.txt · 마지막으로 수정됨: 2020/07/17 10:21 저자 kwon37xi