mtjmtj7的小站
mtjmtj7的小站
© mtjmtj7
All Rights Reserved.

LayUI table使用小提示

LayUI table在配合thymeleaf 使用时,会一直异常(此处省略若干异常…

类似于这样:

018-06-29 14:07:51.492 ERROR 8980 — [nio-8888-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: “class path resource [templates/user/userList.html]”)] with root cause


org.thymeleaf.exceptions.TemplateProcessingException: Could not parse as expression: “
{field:’id’, width:80, title: ‘ID’, sort: true}
,{field:’loginName’, width:80, title: ‘登录名’}
,{field:’email’, width:80, title: ‘邮箱’, sort: true}
,{field:’phone’, width:80, title: ‘phone’}
,{field:’userType’, title: ‘用户类型’, sort: true}
,{field:’name’, title: ‘姓名’, sort: true}
,{field:’password’, title: ‘密码’}
” (template: “user/userList” - line 61, col 14)
因为“[[]]”[[…]]之间的表达式在Thymeleaf被认为是内联表达式
解决方法:1、或者在script标签里 th:inline=”none” 就可以了
2、将[[]]换行成

[

[

]

]

即可

打赏
2019-01-17
62 阅读
暂无评论

发表评论