Spring MVC Controller hierarchy

This section describes the hierarchy of Spring MVC Module.

Spring MVC Controller hierarchy

Spring MVC Controllers - Controllers hierarchy in Spring MVC

    

Controllers hierarchy in Spring MVC

In this we will will understand the controllers hierarchy in Spring MVC Module. The Spring MVC module provides a lot of flexibility to easily develop MVC based web applications. It provides many controllers that can be used to achieve different jobs.

Spring MVC module is based on the MVC design pattern. The main components involved are DispatcherServlet, Controller and Views. In Spring MVC DispatcherServlet plays very important role. It handles the user request and delegates it with Controller. Following diagram shows the very simplified architecture:

In this Spring MVC, DispatcherServlet works as the controller and it delegates the request to the Controller. Developers extends the abstract controller provided by the framework and writes the business logic there. The actual business related processing is done in the Controller.

 Spring MVC provides many abstract controllers, which is designed for specific tasks. Here is the list of anstract controllers that comes with the Spring MVC module:

  1. SimpleFormController
  2. AbstractController
  3. AbstractCommandController
  4. CancellableFormController
  5. AbstractCommandController
  6. MultiActionController
  7. ParameterizableViewController
  8. ServletForwardingController
  9. ServletWrappingController
  10. UrlFilenameViewController
  11. AbstractController
  12. AbstractCommandController
  13. SimpleFormController
  14. CancellableFormController.

Following diagram shows the Controllers hierarchy in Spring MVC:

Spring MVC Controller hierarchy

In the next sections we will be learning about all these controllers. We will also provide you the examples codes illustrating the usage of these controllers.