Javarevisited Newsletter

Javarevisited Newsletter

Share this post

Javarevisited Newsletter
Javarevisited Newsletter
Difference between @Controller and @RestController in Spring MVC?
Copy link
Facebook
Email
Notes
More

Difference between @Controller and @RestController in Spring MVC?

@Controller is used to declare common web controllers which can return HTTP response but @RestController is used to create controllers for REST APIs which can return JSON.

javinpaul's avatar
Soma's avatar
javinpaul
and
Soma
Dec 14, 2023
∙ Paid
8

Share this post

Javarevisited Newsletter
Javarevisited Newsletter
Difference between @Controller and @RestController in Spring MVC?
Copy link
Facebook
Email
Notes
More
3
Share

Hello friends, if you are preparing for a Java developer interview with Spring experience then you may have come across the “difference between @Controller and @RestController annotation” in Spring Boot and Spring Framework in general. It’s one of the popular spring questions and I have seen it many times.

In Spring MVC, both @Controller and @RestContro…

Keep reading with a 7-day free trial

Subscribe to Javarevisited Newsletter to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
A guest post by
Soma
Java and React Developer
Subscribe to Soma
© 2025 javinpaul
Privacy ∙ Terms ∙ Collection notice
Start writingGet the app
Substack is the home for great culture

Share

Copy link
Facebook
Email
Notes
More