The difference between Controller vs RestController in Spring

preview_player
Показать описание
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!
Рекомендации по теме
Комментарии
Автор

This video is amazing. You literally explained it perfectly in 20s, then in even greater detail.

Absolutely GOATed content, I will definitely be checking your other stuff out!

just_dodge_lmao
Автор

So the difference between the Spring RestController and Controller stereotype is just the @RequestBody annotation? That's easy enough.

scrumtuous