SpringMVC是内部是怎么工作的

本文详细介绍了Spring MVC 3.2的工作流程,包括从接收请求到响应生成的全过程。主要步骤涉及DispatcherServlet接收请求、通过HandlerMapping找到控制器、控制器处理请求返回ModelAndView、使用ViewResolver解析视图并最终显示结果。

Let us see the flow of spring MVC (3.2). I am not going to describe what is M,V,C :-)hope you already know that mess right ? so lets start with the flow…

Spring MVC 3.2 Execution Flow

Step 1: First request will be received by DispatcherServlet
Step 2DispatcherServlet will take the help of HandlerMapping and get to know theController class name associated with the given request
Step 3: So request transfer to the Controller, and then controller will process the request by executing appropriate methods and returns ModeAndView object (contains Model data and View name) back to the DispatcherServlet
Step 4: Now DispatcherServlet send the model object to the ViewResolver to get the actual view page
Step 5: Finally DispatcherServlet will pass the Model object to the View page to display the result

That’s it :-)

Just remember this diagram for the interview purpose, i will explain you the practical flow in the first example.

 

 

http://www.java4s.com/spring-mvc/spring-mvc-execution-flow-diagram-spring-mvc-3-2-flow/

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值