@ResponseBody
·
Spring/어노테이션
🧩역할 Response Body를 직접 작성하는 어노테이션@ResponseBody가 없으면 View(파일명)으로 인식✅ 사용 예시차이를 살펴보면, @ResponseBody가 없으니깐, Get 응답에 대한 응답이 없어, Error를 뱉어낸다. @GetMapping("/hello") @ResponseBody public fun hello(): String { return "Hello Spring Boots" } @GetMapping("/hello") public fun hello(): String { return "Hello Spring Boots" // 파일명으로 인식했지만, 파일이 없음 } 출처