Schematic diagram of the working principle of SpringMVC

The above is the working principle diagram of springMVC:

1. The client sends an http request to the web server , and the web server parses the http request. If it matches the request mapping path of DispatcherServlet (specified in web.xml), the web container forwards the request to DispatcherServlet .

2. After DipatcherServlet receives the request, it will find the handler ( Handler ) to process the request according to the requested information (including URL, Http method, request header and request parameter Cookie, etc.) and the configuration of HandlerMapping .

3-4. The DispatcherServlet finds the corresponding Handler according to HandlerMapping , and gives the processing right to the Handler (the Handler encapsulates the specific processing), and then the specific HandlerAdapter makes a specific call to the Handler .

5. Handler will return a ModelAndView() object to DispatcherServlet after data processing is completed .

6. The ModelAndView () returned by Handler is just a logical view and not a formal view. DispatcherSevlet converts the logical view into a real view through ViewResolver .

7. The Dispatcher parses the parameters in ModelAndView() through the model and finally displays the complete view and returns

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325121053&siteId=291194637