Spring MVC architecture
来源:互联网 发布:软件行业能力资质 编辑:程序博客网 时间:2024/06/11 20:05
Spring MVC architecture
Key components in the Spring MVC architecture are shown in the following figure:
Let's look at an example flow and understand the different steps involved in executing the flow. We will take flow 4,
returning ModelAndView as the specific example. The URL of flow 4 is http://localhost:8080/welcome-model-view. The
different steps are detailed as follows:
- The browser issues a request to a specific URL. DispatcherServlet is the Front Controller, handling all requests.
- Dispatcher Servlet looks at the URI (in the example, /welcome-model-view) and needs to identify the right controller
to handle it. To help find the right controller, it talks to the handler mapping.
- Handler mapping returns the specific handler method (in the example, the welcome method in BasicModelViewController)
that handles the request.
- DispatcherServlet invokes the specific handler method (public ModelAndView welcome(ModelMap model)).
- The handler method returns the model and view. In this example, the ModelAndView object is returned.
- DispatcherServlet has the logical view name (from ModelAndView; in this example, welcome-model-view).
It needs to figure out how to determine the physical view name. It checks whether there are
any view resolvers available. It finds the view resolver that was configured
(org.springframework.web.servlet.view.InternalResourceViewResolver).
It calls the view resolver, giving it the logical view name (in this example, welcome-model-view) as the input.
- View resolver executes the logic to map the logical view name to the physical view name.
In this example, welcome-model-view is translated to /WEB-INF/views/welcome-model-view.jsp.
摘录来自: Ranga Rao Karanam. “Mastering Spring 5.0”。 iBooks.
- DispatcherServlet executes the View. It also makes the Model available to the View.
- View returns the content to be sent back to DispatcherServlet.”
- DispatcherServlet sends the response back to the browser.
摘录来自: Ranga Rao Karanam. “Mastering Spring 5.0”。 iBooks.
阅读全文
0 0
- Spring MVC architecture
- Spring Architecture
- MVC Architecture with QT4
- Basic MVC Architecture
- OAF MVC Architecture
- OAF MVC Architecture
- Ext JS MVC Architecture
- Spring Security Architecture翻译
- The Zend Framework MVC Architecture
- The Zend Framework MVC Architecture
- The Zend Framework MVC Architecture
- The Zend Framework MVC Architecture
- The Zend Framework MVC Architecture
- The Zend Framework MVC Architecture
- The Zend Framework MVC Architecture
- ExtJs MVC架构(MVC Architecture)
- MVC architecture in ASP.Net using C#
- the understanding of the MVC architecture
- Tree Cutting 树形dp
- java-mooc浙江大学第三周编程题
- STFT原理及MATLAB代码
- Easy File Sharing Web Server 7.2
- C. Read Time----二分答案
- Spring MVC architecture
- java算法-插入排序
- 51nod 1096 距离之和最小
- WEB 调试神器 -- Firebug
- UVALive4536 POJ3824 HDU3328 Flipper【模拟+堆栈】
- 初识java多线程 (java多线程基础知识汇总)
- 使用Python进行FME的批处理
- sha1sum文件校验
- 对于抽象类与接口的理解