当前位置: 首页 > article >正文

Spring Boot 之 ModelFactory

1.initModel

        功能:

                

public void initModel(NativeWebRequest request, ModelAndViewContainer container, HandlerMethod handlerMethod)
			throws Exception {

		Map<String, ?> sessionAttributes = this.sessionAttributesHandler.retrieveAttributes(request);
		container.mergeAttributes(sessionAttributes);
		invokeModelAttributeMethods(request, container);

		for (String name : findSessionAttributeArguments(handlerMethod)) {
			if (!container.containsAttribute(name)) {
				Object value = this.sessionAttributesHandler.retrieveAttribute(request, name);
				if (value == null) {
					throw new HttpSessionRequiredException("Expected session attribute '" + name + "'", name);
				}
				container.addAttribute(name, value);
			}
		}
	}

2.updateModel


http://www.kler.cn/news/157617.html

相关文章:

  • 【23-24 秋学期】NNDL 作业12 优化算法2D可视化
  • 【蓝桥杯软件赛 零基础备赛20周】第5周——高精度大数运算与队列
  • 基于Python的PyGame的俄罗斯方块游戏设计与实现
  • HostHunter虚拟主机发现
  • 12、pytest上下文友好的输出
  • 【重点】【滑动窗口】76.最小覆盖子串
  • YoloV5改进策略:Swift Parameter-free Attention,无参注意力机制,超分模型的完美迁移
  • VSCode Vue 开发环境配置
  • clip-path,css裁剪函数
  • C语言碎片知识
  • PTA 7-231 买文具
  • 陀螺仪LSM6DSV16X与AI集成(2)----姿态解算
  • 数据结构-栈和队列
  • 一键式紧急报警柱系统
  • 力扣labuladong一刷day27天数组去重
  • 4-Docker命令之docker run
  • 剑指 Offer(第2版)面试题 16:数值的整数次方
  • JAVA-作业7-画一个笑脸
  • 【算法】算法题-20231205
  • 【C++】树型结构关联式容器:map/multimap/set/multisetの使用指南(27)
  • canvas绘制小丑
  • Mysql、Oracle区分大小写?
  • 【新手解答8】深入探索 C 语言:递归与循环的应用
  • spring cloud nacos整合gateway
  • 十五、机器学习进阶知识:K-Means聚类算法
  • 【SQL SERVER】定时任务
  • 【ARM Trace32(劳特巴赫) 使用介绍 12 -- Trace32 常用命令之 d.dump | data.dump 介绍】
  • Linux: 文档 :相关接口文档手册还是需要仔细阅读
  • mfc 设置excel 单元格的列宽
  • EM32DX-C4【C#】