Playing with Spring MVC

In Spring MVC, the following is a pattern of a simplified request handling mechanism:

  1. DispatcherServlet receives a request and confers the request with handler mappings to find out which controller can handle the request, and then passes the request to that controller.
  2. The controller performs the business logic (can delegate the request to a service or business logic processor) and returns some information back to DispatcherServlet for user display or response. Instead of sending the information (model) directly to the user, the controller returns a view name that can render the model.
  3. DispatcherServlet then resolves the physical view from the view name and passes the model object to the view. This way, DispatcherServlet

Get Mastering Unit Testing Using Mockito and JUnit 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.