Skip to content
thesarfo

Concept

Spring Start Here: The Spring MVC Flow

The five-step request lifecycle in Spring MVC, from dispatcher servlet to rendered response.

views 0

The Spring MVC flow looks like this:

  1. The client sends an HTTP request to the web server.
  2. The dispatcher servlet uses the handler mapping to find out which controller action to call.
  3. The dispatcher servlet calls the controller’s action.
  4. After executing the action, the controller returns the view name the dispatcher servlet needs to render into the HTTP response.
  5. The response is sent back to the client.

Step 4 is where things get interesting — we want the controller to return not just the view name, but also send data to the view. The view incorporates this data to build the actual HTTP response.