Tell me about the spring MVC running process?

Alibaba cloud Q & A 2022-02-13 09:05:14 阅读数:760

tell spring mvc running process

The way spring mvc Operation process ?

Take the answer 1:

1、 User sends request to server , Request to be Spring front control Servelt DispatcherServlet Capture ( Capture )

2、 DispatcherServlet Request for URL To analyze , Get request resource identifier (URI). Then according to the URI, call HandlerMapping To obtain the Handler All related objects configured ( Include Handler Objects and Handler Object corresponding interceptor ), Finally HandlerExecutionChain Object's form return ;( lookup handler)

3、 DispatcherServlet According to the Handler, Choose the right one HandlerAdapter. extract Request Model data in , fill Handler Enter the reference , Start execution Handler(Controller), Handler After execution , towards DispatcherServlet Return to one ModelAndView object ( perform handler)

4、DispatcherServlet According to the returned ModelAndView, Choose the right one ViewResolver( Must be registered to Spring In container ViewResolver) ( choice ViewResolver)

5、 adopt ViewResolver combination Model and View, To render a view ,DispatcherServlet Return render results to the client .( Render return )

copyright:author[Alibaba cloud Q & A],Please bring the original link to reprint, thank you.