ParseException: Could not parse as expression

at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Thread.java:745)
Caused by: org.attoparser.ParseException: Could not parse as expression: "
                {
    
    field: 'name', title: '名称', width:200}
                ,{
    
    field: 'money', title: '价格', width:200, sort: true}
                ,{
    
    field: 'miaoshu', title: '描述', width:200}
                ,{
    
    field: 'id', title: 'id', width:200, sort: true}
                ,{
    
    title: '操作',fixed: 'right',toolbar: '#barDemo', width:200} //这里的toolbar值是模板元素的选择器
            " (template: "home" - line 65, col 22)
	at org.attoparser.MarkupParser.parseDocument(MarkupParser.java:393)
	at org.attoparser.MarkupParser.parse(MarkupParser.java:257)
	at org.thymeleaf.templateparser.markup.AbstractMarkupTemplateParser.parse(AbstractMarkupTemplateParser.java:230)
	... 40 more
Caused by: org.thymeleaf.exceptions.TemplateProcessingException: Could not parse as expression: "
                {
    
    field: 'name', title: '名称', width:200}
                ,{
    
    field: 'money', title: '价格', width:200, sort: true}
                ,{
    
    field: 'miaoshu', title: '描述', width:200}
                ,{
    
    field: 'id', title: 'id', width:200, sort: true}
                ,{
    
    title: '操作',fixed: 'right',toolbar: '#barDemo', width:200} //这里的toolbar值是模板元素的选择器
            " (template: "home" - line 65, col 22)
	at org.thymeleaf.standard.expression.StandardExpressionParser.parseExpression(StandardExpressionParser.java:131)
	at org.thymeleaf.standard.expression.StandardExpressionParser.parseExpression(StandardExpressionParser.java:62)
	at org.thymeleaf.standard.expression.StandardExpressionParser.parseExpression(StandardExpressionParser.java:44)

原因
在js中定义了一个数组:cols:[[{...},{...}]],thymeleaf可能会认为是自己的标签。

解决方案
<script type="text/javascript" > 加上 th:inline=“none”

<script th:inline="none">

猜你喜欢

转载自blog.csdn.net/qq_42158942/article/details/103978799