As @RestController is composition of @Controller and @ResponseBody, I believe if I want my controller to work as both
MVC and REST con
@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.