How it works

Key components in the Spring MVC architecture are shown in the following figure:

Let's look at an example flow and understand the different steps involved in executing the flow. We will take flow 4, returning ModelAndView as the specific example. The URL of flow 4 is http://localhost:8080/welcome-model-view. The different steps are detailed as follows:

  1. The browser issues a request to a specific URL. DispatcherServlet is the Front Controller, handling all requests. So, it receives the request.
  2. Dispatcher Servlet looks at the URI (in the example, /welcome-model-view) and needs to identify the right controller to handle it. To help ...

Get Mastering Spring 5.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.