thymeleaf+layui加载页面渲染时TemplateProcessingException: Could not parse as expression: "

warning: 这篇文章距离上次修改已过335天,其中的内容可能已经有所变动。

出现类似:

                {type: 'numbers'},
                {field: 'name', title: 'name'},
                {field: 'id', title: 'id'},
                {field: 'sex', title: 'sex'},
                {field: 'pid', title: 'pid'}
                " (template: "backadmin/menu/menuIndex" - line 69, col 25)
at org.attoparser.MarkupParser.parseDocument(MarkupParser.java:393)
at org.attoparser.MarkupParser.parse(MarkupParser.java:257)
at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parse(AbstractMarkupTemplateParser.java:230)
... 53 common frames omitted

Caused by: org.thymeleaf.exceptions.TemplateProcessingException: Could not parse as expression: "

                {type: 'numbers'},
                {field: 'name', title: 'name'},
                {field: 'id', title: 'id'},
                {field: 'sex', title: 'sex'},
                {field: 'pid', title: 'pid'}

解决方式

1.也就是把cols后的[[ ]]变为

[

[

]

]

因为[[…]]之间的表达式在thymeleaf被认为是内联表达式,所以渲染错误

2.或者在 |

Copyright © 2024 我的学习笔记
Powered by Typecho | Theme by Waxy | 京ICP备18019712号