To start with , the Spring Controller is a Spring MVC functionality, which is an add on the the IOC functionality of Spring.
In the Spring MVC Architecture, The Controller differs from the Front Controller. In this case here is the difference of the two:
Front Controller – Accepts incoming HTTP requests, Only forwards the request to the Controller, then awaits for the final data ( webpage, etc.. ) output to be send out as the HTTP response.
Controller – Accepts the forwarded HTTP request, Handle and do logic in it, It may use a Model Class/Data within it, then sends it back to the Front Controller, which then creates a View to become a response just a response back ( No View involved ).
The Basic Controller
The Controller here will be represented by a single Class. To make a Class a Controller, this has to be implemented in the Class.
– Must be annotated with “@Controller”.
Spring will automatically reconize that this is the Controller Class,
capable of handling requests.
– It can handle request by a method with @RequestMapping annotation.
The detailed explanation is found in this site: