[Spring] ObjectMapper의 동작 방식과 SpringBoot가 제공하는 추가 기능들
이번에는 Spring에서 사용되는 ObjectMapper의 동작 방식에 대한 정리해보도록 하겠습니다. 1. ObjectMapper를 이용한 직렬화(Serialize) [ ObjectMapper의 직렬화(Serialize) 동작 방식 ] ObjectMapper는 리플렉션을 활용해서 객체로부터 Json 형태의 문자열을 만들어내는데, 이것을 직렬화(Serialize)라고 한다. 해당 부분은 @ResponseBody나 @RestController 또는 ResponseEntity 등을 사용하는 경우에 처리된다. Spring에서는 기본적으로 jackson 모듈의 ObjectMapper라는 클래스가 직렬화를 처리한다. 그리고 그 과정에서 ObjectMapper의 writeValueAsString이라는 메소드가 사용된..