What is the Difference Between @Controller and @RestController in Spring MVC?
Briefly

@Controller is an annotation used in Spring MVC to indicate that a particular class serves the role of a controller in the Model-View-Controller (MVC) design pattern.
@RestController is a specialized version of @Controller. It combines @Controller and @ResponseBody, directly returning data as JSON or XML instead of a view.
The most significant difference lies in how they handle return values: @Controller returns view names, while @RestController automatically serializes return values to formats like JSON.
@RestController eliminates the need to annotate each method with @ResponseBody, as all methods in a class with @RestController have their return values serialized.
Read at CodeProject
[
]
[
|
]