The difference between Controller vs RestController in Spring

Published: 01 January 1970
on channel: Cameron McKenzie
1,329
43

The difference between the Spring Controller versus RestController is the fact that the RestController implicitly adds the ResponseBody annotation to every HTTP handling method while you have to do that explicitly with the standard Spring Controller from Spring MVC.

That's it. That's the only difference between the Spring Controller and RestController.

So when do you use the Spring RestController over the Controller? Well, any time you're doing RESTful API development with Spring Boot! That's when!


Watch video The difference between Controller vs RestController in Spring online, duration hours minute second in high quality that is uploaded to the channel Cameron McKenzie 01 January 1970. Share the link to the video on social media so that your subscribers and friends will also watch this video. This video clip has been viewed 1,329 times and liked it 43 visitors.