It is more of an observation than a question because I spent more than 2-3 hrs just figuring out which annotation should be used according to our needs.
According to me, @Controller is used when we are making a proper MVC application that will do internal routing for the app and give a response along with a View(HTML PAGE) instead of exposing raw details.@RestController is used when we are making a RestFul App whose purpose is only to get the data fetched from the DB and perform a query. The Data which we get while using the @RestController is in JSON format.
I want to know why spring behaves in this particular manner and is there some internal working that a SpringBoot learner should know for making restful APIs.