Blog

Your dream job? Lets Git IT.
Interactive technical interview preparation platform designed for modern developers.

XGitHub

Platform

  • Categories

Resources

  • Blog
  • About the app
  • FAQ
  • Feedback

Legal

  • Privacy Policy
  • Terms of Service

© 2025 LetsGit.IT. All rights reserved.

LetsGit.IT/Categories/Spring
Springeasy

`@RestController` vs `@Controller` — what changes?

Tags
#restcontroller#controller#spring-mvc
Back to categoryPractice quiz

Answer

`@RestController` is basically `@Controller` + `@ResponseBody`, so methods return the response body (often JSON) directly. `@Controller` is typically used for server-rendered views/templates.

Related questions

Spring
`@RestController` vs `@Controller`: what’s the difference?
#spring#mvc#controller
Spring
`@RequestParam` vs `@PathVariable` — when do you use which?
#spring-mvc#requestparam#pathvariable