thymeleaf+layui加载页面渲染时,TemplateProcessingException: Could not parse as expression:
生活随笔
收集整理的這篇文章主要介紹了
thymeleaf+layui加载页面渲染时,TemplateProcessingException: Could not parse as expression:
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
錯(cuò)誤截圖:
錯(cuò)誤代碼:
table.render({elem: '#demo',height: 312,url: '/list' //數(shù)據(jù)接口,page: true //開(kāi)啟分頁(yè),cols: [[ //表頭{field: 'id', title: 'ID', width:80, sort: true, fixed: 'left'},{field: 'username', title: '用戶名', width:80},{field: 'password', title: '密碼', width:80, sort: true},{field: 'email', title: '郵箱', width:80},{field: 'status', title: '狀態(tài)', width: 177},{field: 'code', title: 'uuid', width: 80, sort: true}]]});});錯(cuò)誤原因:
因?yàn)閇[…]]之間的表達(dá)式在thymeleaf被認(rèn)為是內(nèi)聯(lián)表達(dá)式,所以渲染錯(cuò)誤
解決方法:
把cols后的[[ ]]變?yōu)?/p>
[
[]]
正確代碼:
table.render({elem: '#demo',height: 312,url: '/list' //數(shù)據(jù)接口,page: true //開(kāi)啟分頁(yè),cols: [[ //表頭{field: 'id', title: 'ID', width:80, sort: true, fixed: 'left'},{field: 'username', title: '用戶名', width:80},{field: 'password', title: '密碼', width:80, sort: true},{field: 'email', title: '郵箱', width:80},{field: 'status', title: '狀態(tài)', width: 177},{field: 'code', title: 'uuid', width: 80, sort: true}]]});});總結(jié)
以上是生活随笔為你收集整理的thymeleaf+layui加载页面渲染时,TemplateProcessingException: Could not parse as expression:的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: WebMvcConfigurerAdap
- 下一篇: Google Hack 搜索使用