SpringMVC_ implementation of the principle of

springMVC schematics:

springMVC execute schematics:

Preparation, after the aid maven import dependence, registered DisPatchServlet in web.xml.

There are four core springMVC: front-end controller processor mapping processor adapter view resolver

A brief analysis of the implementation process

  1. It represents DispatcherServlet front controller, the whole SpringMVC control center. Requesting user, DispatcherServlet receives the request and interception request.

    • We assume that the request url is:  HTTP: // localhost : 8080 / SpringMVC / the Hello
    • As url split into three parts:
    • HTTP: // localhost : 8080 Server domain
    • SpringMVC deployed on the server's web site
    • hello indicates that the controller
    • Analysis, as described above url: Request a server located localhost: hello controller on site SpringMVC 8080.
  2. HandlerMapping processor mapping. DispatcherServlet call HandlerMapping, HandlerMapping url look Handler upon request.
  3. HandlerExecution shows a specific Handler, its main role is to find a controller according to url, url be searched as controller: hello.
  4. HandlerExecution transmitting the analysis information to DispatcherServlet, mapping controller resolver.
  5. HandlerAdapter adapter indicates that the processor, which performs Handler to specific rules.
  6. Handler let specific Controller to perform.
  7. Controller The specific implementation information back to HandlerAdapter, such ModelAndView.
  8. The view logic HandlerAdapter or model name passed to DispatcherServlet.
  9. DispatcherServlet call the view resolver (ViewResolver) to resolve the logical view name HandlerAdapter transfer.
  10. View resolver resolves the logical view name passed DispatcherServlet.
  11. According DispatcherServlet view results view parser, call the specific view.
  12. The final view presented to the user.

Content Sources https://blog.kuangstudy.com/index.php/archives/311/ blogger, please contact delete infringement

Guess you like

Origin www.cnblogs.com/GOOGnine/p/12193130.html