Returning view from Spring MVC @RestController

后端 未结 2 1537
广开言路
广开言路 2020-11-30 11:31

As @RestController is composition of @Controller and @ResponseBody, I believe if I want my controller to work as both MVC and REST con

2条回答
  •  情歌与酒
    2020-11-30 12:10

    @RestController annotation, which marks this class as a controller where every method returns a domain object/pojo instead of a view. It means that we are no more using view-resolvers, we are no more directly sending the html in response but we are sending domain object converted into format understood by the consumers.

提交回复
热议问题