我有这个Thymeleaf代码:
<table> <tr th:each="row : ${table.rows}"> <td th:each="column : ${table.columns}"> <span th:text="${column.value(row)}"/> </td> </tr></table>
这会导致异常:
Exception evaluating SpringEL Expression: "column.value(row)"
甚至可以在Thymeleaf这样做,例如将变量传递给其他变量的方法?
解决方法 我发现了这个问题,因为我向这个方法传递了一些东西,它不是一个getter方法所以我必须提供完整的方法名称:getValue不仅仅是值:<table> <tr th:each="row : ${table.rows}"> <td th:each="column : ${table.columns}"> <span th:text="${column.getValue(row)}"/> </td> </tr></table>总结
以上是内存溢出为你收集整理的html-table – 对象上的Thymeleaf调用方法全部内容,希望文章能够帮你解决html-table – 对象上的Thymeleaf调用方法所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)