Skip to content
Mkyong.com
Mkyong.com
  • Development Service
  • Spring Boot
  • Java 8
  • Contact

rest api

Spring Boot @Controller vs @RestController Example

June 9, 2026June 9, 2026 by mkyong

Learn the difference between @Controller and @RestController in Spring Boot with simple, runnable examples and clear output. Beginner-friendly guide.

Categories spring boot Tags @RestController, controller, rest api, spring boot, web Leave a comment

Mkyong.com has provided Java and Spring tutorials, guides, and code snippets since 2008. All published articles are simple, easy to understand, and well-tested in our development environment.

Mkyong.com licenses all source code on this website under the MIT License.

Tools
  • Spring Framework
  • Quarkus Framework
  • Micronaut Framework
  • Oracle Java JDK
  • Eclipse Temurin JDK
  • OpenJDK JDK
  • Hibernate ORM
  • Maven Build Tool
  • Gradle Build Tool
  • Tomcat Application Server
  • Docker
Links
  • Spring Guides
  • Docker Hub
  • Maven Central
  • Keep A Changlog
  • Semantic Versioning
  • Hugging Face - Qwen
  • Martin Fowler
About
  • About Us
  • Code License
  • Privacy Policy
  • Terms Of Use
  • Contact Us
© 2026 Mkyong.com - Build with Love.