RESTful(4) - @RestController 사용하기 (단순문자열, 객체타입, List타입, Map타입)
@RestController → @Responsebody없이도 처리됨 (생략) @Controller와는 다르게 @RestController는 리턴값에 자동으로 @ResponseBody를 붙게되어 HTTP 응답데이터(body)에 자바 객체가 매핑되어 전달 된다고 한다. ( ※ @Controller인 경우에는 @ResponseBody를 적어줘야 합니다. ) 1. 단순 문자열 문자열 데이터 → 기본적으로 text/html 타입으로 처리됨, 일반 문자열이 반환 package com.bitcamp.mvc; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.Request..