thyemeleaf 遍历问题
来源:互联网 发布:淘宝宝贝违规下架工商 编辑:程序博客网 时间:2024/06/05 12:40
List<com.bean.Class> list= classService.getAll();
model.addAttribute("classes", list);
<div th:each="mylist,mylistStat:${classes}">
<!-- <option th:value="${student.classid}" th:text="${student.classx.classname}">这里写啥不重要</option> -->
<div th:value="${mylist.classid}" th:text="${mylist.classname}">这里写啥不重要</div>
</div>
这个写的没什么毛病,也可以成功但是model.addAttribute("classes", list);的名字不能叫class 我自己给自己找麻烦设成了class
Property or field 'classid' cannot be found on object of type 'org.thymeleaf.context.WrappingVariablesMap' - maybe not public? 报这个错误,因为他会自己寻找一个默认的名为class的model。导致遍历报错
阅读全文
0 0
- thyemeleaf 遍历问题
- 遍历问题
- 遍历问题
- 遍历问题
- 马的遍历问题
- 遍历矩阵格问题
- 二叉树遍历问题
- RMS遍历问题
- 前序中序遍历问题
- 骑士遍历问题
- 马的遍历问题
- 二叉树遍历问题
- sdcard 遍历问题
- 马的遍历问题
- 数据结构《遍历问题》
- 方格遍历问题
- wikioi 1029 遍历问题
- cursor遍历的问题
- PHP函数详解:call_user_func()使用方法
- vue项目中-打印页面中部分区域的内容
- PDO 的应用 数据操作
- uva670
- js正则表达式:密码至少8位,要求必须字母、数字加英文符号
- thyemeleaf 遍历问题
- Qt笔记(4)操作XML二
- 加快qt编译:设置默认多核编译qt
- java连接Hbase+Kerberos配置参数示例
- MySQL数据库学习02-数据表的基本操作:创建
- 机器学习算法:朴素贝叶斯
- JAVA: getRequestDispatcher()与sendRedirect()的区别
- 183.134.16.17无高防,不酣畅,快快网络台州三线高防给您极致体验
- Volley源码及流程分析