当前位置:网站首页>Explore how @ modelandview can forward data and pages through the source code
Explore how @ modelandview can forward data and pages through the source code
2022-04-23 07:07:00 【0oIronhide】
First of all ModelAndView Enclosed model Data and view name , stay return Break points in sentences ,url Access to controller,
Back in ModelAndView Before the object ,springmvc Will call first DispatcherServlet Class doDispatch Method ,
In this method, there is through HandlerAdapter obtain controller in ModelAndView Object method ha.handle()
:
When debug When the method is
You can see the mv The object is null, When you're done with this ha.handle()
Look after the method mv:
model Data in and view I got all the view names , Walk the ha.handle()
After method , Enter into DispatcherServlet Class processDispatchResult()
You can see that the middle note is called in this method. this.render(mv, request, response);
Method , Judge mv Enter after object render In submission method , See the call in this method view.render()
Method ,mv.getModelInternal()
Is to get model data ;
Get into view.render()
Method :
The call this.renderMergedOutputModel()
, Enter this method :
It calls two key methods ,this.exposeModelAsRequestAttributes(model, request);
And rd.forward(request, response);
, The second method is easy to identify ,rd Namely request Of RequestDispatcher call forward Forward page , You can guess exposeModelAsRequestAttributes()
The way is to put model The data in request, Get into exposeModelAsRequestAttributes()
:
In this method, we see request.setAttribute(modelName, modelValue);
, It can be confirmed that the method is to model Data assignment request;
The following is a diagram to illustrate the process :
版权声明
本文为[0oIronhide]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230600133156.html
边栏推荐
- oracle undo使用率高问题处理
- Introduction to common APIs for EBFP programming
- Abnormal record-21
- Arranges the objects specified in the array in front of the array
- Exception record-8
- oracle用delete删除数据所需时间测试
- timestamp隐式转换问题导致索引列未使用问题分析
- Prometheus cortex Architecture Overview (horizontally scalable, highly available, multi tenant, long-term storage)
- Kubernetes CoreDNS常见问题资料参考
- 基于ECS搭建云上博客(云小宝码上送祝福,免费抽iphone13任务详解)
猜你喜欢
Dolphinscheduler调度sql任务建表时The query did not generate a result set异常解决
Prometheus cortex Architecture Overview (horizontally scalable, highly available, multi tenant, long-term storage)
阿里云日志服务sls的典型应用场景
oracle undo使用率高问题处理
Relabel of Prometheus_ Configs and metric_ relabel_ Configs explanation and usage examples
开篇:双指针仪表盘的识别
Introduction to RDMA
qs. In the stringify interface, the input parameter is converted into a & connected string (with the application / x-www-form-urlencoded request header)
Introduction to RDMA network
Oracle Job定时任务的使用详解
随机推荐
Dolphinscheduler源码包src.tar.gz解压问题
异常记录-11
Comparison between Prometheus thanos and cortex components
Prometheus监控influxdb的方法及指标释义
OSS云存储管理实践(体验有礼)
通过rownum来进行区间查询
Abnormal record-19
switch case时连写常规判断表达式的错误 case和if并用 l
异常记录-12
测试oracle库700万数据量普通方式创建索引所需时间
pg库查看某模式下某表的分布键
异常记录-18
oracle 修改默认临时表空间
Prometheus的relabel_configs和metric_relabel_configs解释及用法示例
oracle undo使用率高问题处理
Prometheus thanos Quick Guide
异常记录-17
Using Prom label proxy to implement label based multi tenant reading of Prometheus thanos
oracle生成毫秒级时间戳
JS function package foreach use return can not jump out of the outer function