Explain the difference between spring @Controller and @RestController annotation

Technology CommunityCategory: SpringExplain the difference between spring @Controller and @RestController annotation
VietMX Staff asked 3 years ago
  • @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