liveBook · Manning

Front controller

As explained in Spring Start Here, Second Edition

A front controller is an architectural pattern in which a single entry point centrally processes requests and dispatches them to appropriate handlers.

A front controller is a single entry point that manages incoming requests and dispatches them inside a web app. In Spring MVC, Tomcat calls the DispatcherServlet, which uses handler mapping to find a controller action, then a view resolver to locate the page to return. If no action matches, the app responds with 404 Not Found. section 7.3

Figure 7.18 The Spring MVC architecture. In the diagram, you find the main components of Spring MVC. These components and the way they collaborate are responsible for a web app’s behavior. The controller (shaded differently) is the only component you implement. Spring Boot configures the other components.

See how the DispatcherServlet, controller, and other Spring MVC components collaborate. section 7.3

How Spring Start Here, Second Edition covers it

How deep it goes
Traces dispatch through handler mapping and view resolution, while deferring detailed treatment of HTTP methods.
Examples
Follows a Tomcat request to a mapped controller action, rendered view, or 404 response.
What you can do after
Evaluate/understand how Spring MVC routes a request and returns its response.
How it connects
Connects Spring MVC, servlets, handler mapping, controllers, and view resolvers.

This explainer was generated by Manning's knowledge graph from the text of Spring Start Here, Second Edition. The section links point to the parts of the book it draws on.