Notice
Recent Posts
Recent Comments
Link
«   2025/05   »
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
Archives
Today
Total
관리 메뉴

0gam

@Controller , @RestController 본문

Spring Framework

@Controller , @RestController

byeon0gam 2016. 9. 20. 12:44
  • @Controller is used to mark classes as Spring MVC Controller.
  • @RestController is a convenience annotation that does nothing more than adding the @Controller and @ResponseBody annotations (see: Javadoc)

So the following two controller definitions should do the same

@Controller
@ResponseBody
public class MyController { }

@RestController
public class MyRestController { }



'Spring Framework' 카테고리의 다른 글

ComponentScan  (0) 2018.05.23
spring security session-registry  (0) 2017.02.08
produces, consumes  (0) 2016.07.27
@JsonIgnoreProperties(ignoreUnknown = true)  (0) 2016.07.07
Azure Web Service enable Cookie.  (0) 2016.06.24