Personal introduction and understanding of spring MVC

Principles of springmvc framework (master)

Front controller, processor mapper, processor adapter, view resolver

Getting started with springmvc

Purpose: To learn
  non-annotated processor mappers for front controllers, processor mappers, processor adapters, and view parsers , processor mappers  
    annotated by processor adapters, processor adapters (master)

    
 springmvc and mybatis integration

 springmvc annotations Development:  

 commonly used annotation learning  

 parameter binding (simple type, pojo, collection type)  
 custom parameter binding (master) 
  springmvc is a module of the spring framework, springmvc and spring do not need to be integrated through an intermediate integration layer. springmvc is a web framework based on mvc.

  Spring integrates the various layers 

  through the spring management persistence layer mapper (equivalent to the dao interface) 
  through the spring management business layer service, the service can call the mapper interface spring for transaction control.  
  Through the spring management presentation layer Handler, the service interface can be called in the Handler. The

  first step: integrate the dao layer mybatis and spring integration, and manage the mapper interface through spring. Use mapper's scanner to automatically scan the mapper interface for registration in spring.

    Step 2: Integrate the service layer Manage the service interface through spring. Use the configuration method to configure the service interface in the spring configuration file. Realize transaction control. 
   
    Step 3: Integrate springmvc Since springmvc is a spring module, there is no need to integrate.
   
    A. Load web.xml, read the configuration, start SpringMVC
    B. Send URL request, match the rule *.do, instantiate SpringMVC Servlet object
    C. Scan the annotation path, find the mark annotation @Controller layer
    D. According to the URI request address , Match the value of the annotation @RequestMapping on the
    method E. Execute the method
    F. parse the return value, match the default view parser, and splice it into a jump URI

Guess you like

Origin blog.csdn.net/weixin_46895251/article/details/108479537