@Controller

    @Controller, @RestController 어노테이션 차이

    @Controller, @RestController 어노테이션 차이

    @Controller와 @RestController의 차이점 Spring의 annotation 기반 MVC 프레임워크는 RESTful 웹서비스를 만드는 과정을 단순화한다. 전통적인 방식의 @Controller 어노테이션은 오랫동안 MVC 프레임워크로 사용되어 왔다. Spring 4.0에서 소개된 @RestController 어노테이션은 @Controller 및 @ResponseBody를 생략하여 RESTful 웹 서비스를 쉽게 개발할 수 있도록 만들어 준다. 두 어노테이션의 차이점은 HTTP Response body가 생성되는 방식이다. @Controller은 View가 반환되고, @RestController은 객체를 반환하고 객체 데이터는 JSON 또는 XML로 HTTP 응답에 작성된다. @Contro..