SpringBoot使用thymeleaf和layui時(shí)遇到的問題
在使用thymeleaf時(shí)報(bào)錯(cuò)
An error happened during template parsing (template: "class path resource [templates/mainPage/main.html]" - line 134, col 168)
我最后找了 很久發(fā)現(xiàn)報(bào)錯(cuò)的那一行有個(gè)HTML結(jié)束標(biāo)簽不對,改好之后頁面就可以正常顯示了。
每個(gè)人報(bào)的錯(cuò)誤都可能不同,仔細(xì)看一下報(bào)錯(cuò)的內(nèi)容和具體行數(shù)。
thymeleaf+layui加載頁面渲染時(shí)TemplateProcessingException: Could not parse as expression: "
org.attoparser.ParseException: Could not parse as expression
也就是把cols后的[[ ]]變?yōu)?br>
[
[
]
]
因?yàn)閇[…]]之間的表達(dá)式在thymeleaf被認(rèn)為是內(nèi)聯(lián)表達(dá)式,所以渲染錯(cuò)誤

浙公網(wǎng)安備 33010602011771號