SpringBoot使用thymeleaf和layui时遇到的问题

在使用thymeleaf时报错
An error happened during template parsing (template: "class path resource [templates/mainPage/main.html]" - line 134, col 168)
我最后找了 很久发现报错的那一行有个HTML结束标签不对,改好之后页面就可以正常显示了。

每个人报的错误都可能不同,仔细看一下报错的内容和具体行数。




thymeleaf+layui加载页面渲染时TemplateProcessingException: Could not parse as expression: "
org.attoparser.ParseException: Could not parse as expression
也就是把cols后的[[ ]]变为

[

    [

    ]

]

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

posted @ 2020-03-03 12:01  RickL  阅读(1280)  评论(1编辑  收藏  举报