пятница, 3 января 2020 г.

@Controller vs @RestController - Spring


  • @RestController - it's just convenience way to combine two annotations: @Controller and @ResponseBody (to simplify the creation of RESTfull web services) see link;
  • using @Controller - we have to use @ResponseBody, using @RestController - no!
  • @Controller - return view, @RestController - return domain object.

Комментариев нет:

Отправить комментарий