일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 | 31 |
- grpc
- Spring JPA
- CompletableFuture
- micrometer tracing
- asynccustomautoconfiguration
- map
- traceasynccustomautoconfiguration
- @FunctionalInterface
- wire type
- HashMap
- elasticsearch
- Spring Boot
- EnableWebMvc
- DeferredImportSelector
- spring MVC
- awssecretsmanagerpropertysources
- java lambda
- list
- java list
- spring
- traceId
- ResponseBody
- aws secretmanager
- SpringMVC
- jpa
- kotlin
- asyncconfigurer
- java
- java.util.list
- Sleuth
- Today
- Total
목록ResponseBody (2)
du.study기록공간

저번 글에서 ResponseBody응답으로 간단한 Spring타입에 대해서 리턴받는 방식을 기록한 적이 있습니다. (해당글은 여기에 :https://duooo-story.tistory.com/9) 이번에는 일반적으로 사용되는 Object를 json형태로 return 받는 방식에 대해서 살펴보려 합니다. @RequestMapping("/jackson") @ResponseBody public TestDomain helloObject() { // 뭔가를 받아와서 도메인을 만들었다 가정하고.. TestDomain tobj = new TestDomain("du",10); return tobj; } 만약 @EnableWebMvc ,WebMvcConfigurer등에대한 기본 설정만 한 상태라면 다음과 같은 에러를 맞..
API를 만들때, Json형태의 응답값을 내려주기 위하여 @ResponseBody 라는 어노테이션을 사용합니다. 이 어노테이션을 사용하면 본문 자체를 응답값으로 내려주기에 유용하게 사용하고 있지만. 정확하게 어떻게 동작하는지를 확인하기 위해서 내부 동작을 확인해보려고 합니다. 그중에서도 현재 RequestMappingHandlerAdapter 를 사용하는 케이스만 구현하고 있어 먼저 이 핸들러 어뎁터 기준으로 디버깅을 하여 확인한 결과를 작성합니다. 결론부터 간략하게 정리해보면 다음과 같습니다. 1. DispatcherServlet에서 핸들러 어뎁터(RequestMappingHandlerAdapter) 실행 2. HandlerMethodReturnValueHandler에서 RequestResponseBo..