Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Detailed explanation and simple configuration of SpingMVC Workflow

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

First, let's take a look at its entire invocation process:

1. The user sends the request to the front-end controller DispatcherServlet, which manages the whole life cycle of the request, from the request to the response.

2. DispatcherServlet receives a request to call the HandlerMapping processor mapper.

3. Find the specific processor from the processor mapper, generate the processor object and the processor interceptor (if any) and return it to DispatcherServlet.

4. DispatcherServlet calls HandlerAdapter processor adapter

5. HandlerAdapter calls the specific processor (Controller, also known as the back-end controller) after adaptation.

6. Return ModelAndView after Controller execution is completed

7. HandlerAdapter returns the controller execution result ModelAndView to DispatcherServlet

8. DispatcherServlet passes ModelAndView to ViewReslover view parser

9. Return specific View after ViewReslover parsing

10. DispatcherServlet renders the view according to the View (populating the model data into the view).

11. DispatcherServlet responds to users

Let's unify a simple Demo to understand the basic quota configuration:

1. First, create a project through Maven, add Spring-web framework to the project, and automatically load spring-related dependent files and generate xml configuration files. Take a look at web.xml first.

ContextConfigLocation / WEB-INF/applicationContext.xml org.springframework.web.context.ContextLoaderListener dispatcher org.springframework.web.servlet.DispatcherServlet 1 dispatcher / 30 redirect.jsp

Dispartcher-servlet.xml file

IndexController

ApplicationContext.xml

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report