Exception processing template “admin/table“: Could not parse as expression: “(thymeleaf与layui冲突)
問題描述
使用thymeleaf+layui在頁面渲染的時候出現(xiàn)如下錯誤
[THYMELEAF][http-nio-8080-exec-7] Exception processing template “admin/table”: Could not parse as expression: "
這里是JS中的文件字段
{type: “checkbox”, width: 50},
{field: ‘a(chǎn)dminId’, width: 80, title: ‘ID’, sort: true},
{field: ‘a(chǎn)dminType’, width: 80, title: ‘類型’},
{field: ‘a(chǎn)dminName’, width: 80, title: ‘姓名’, sort: true},
{field: ‘a(chǎn)dminCreateTime’, width: 80, title: ‘創(chuàng)建時間’},
{field: ‘a(chǎn)dminPosition’, title: ‘部門ID’, minWidth: 150},
{field: ‘a(chǎn)dminStatus’, width: 80, title: ‘狀態(tài)’, sort: true},
{field: ‘loginIp’, width: 80, title: ‘上次登錄的ip’, sort: true},
{title: ‘操作’, minWidth: 150, toolbar: ‘#currentTableBar’, align: “center”}
錯誤分析
Could not parse as expression:無法解析為表達式
根據(jù)報錯的地方提示,我來來看看為什么會說這是一個表達式呢,這明明就是我的js字段。
在代碼中,它是這樣的
thymeleaf中,可以這么取數(shù)據(jù)[[${model}]],問題就出現(xiàn)在了這里,thymeleaf認為[[是它自家的,我就是要解析,但是又解析不出來。
解決方案
js屬于弱類型編程語言,thymeleaf屬于強類型語言,只要在中間加個空格或者回車即可,如下圖所示
總結(jié)
以上是生活随笔為你收集整理的Exception processing template “admin/table“: Could not parse as expression: “(thymeleaf与layui冲突)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: docker镜像底层是文件联合系统
- 下一篇: docker镜像为什么要采用分层结构