controller (1) 썸네일형 리스트형 [Spring] @Controller / @ResponseBody / @RestController 를 알아보자 Spring에서 컨트롤러를 지정해주기 위한 어노테이션은 @Controller와 @RestController 2가지가 있다. @Controller와 @RestController의 주요한 차이점은 HTTP Response Body가 생성되는 방식이다. ※ @RestController는 @Controller와 @ResponseBody의 조합이다. ※ Spring 프레임 워크에서 RESTful 웹 서비스를 보다 쉽게 개발 할수 있도록 Spring 4.0에서 추가되었다. [@Controller] - @Controller는 Model 객체를 만들어 데이터를 담고 View를 반환하기 위해 사용한다. - @ResponseBody를 사용하면 View를 리턴하지 않고 Controller에서 직접 데이터 리턴이 가능하다. .. 이전 1 다음