解析 thymeleaf 模板时出错 [英] Error parsing thymeleaf template

查看:156
本文介绍了解析 thymeleaf 模板时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这让我困扰了一段时间,网上似乎没有任何帮助;基本上我找不到特定异常消息的任何内容,除了异常消息我不知道要查找什么.

this is bugging me for a while and there seems to be nothing helpful online; basically I can't find anything for the particular exception message, and I have no idea what to look for other than the exception message.

我的应用程序中有一个收据页面,以前可以使用,但现在它会抛出

I've got a receipt page in my application, that used to work, but now it throws

org.thymeleaf.exceptions.TemplateProcessingException: Error processing template: dialect prefix "th" is set as non-lenient but attribute "th:src" has not been removed during process (/static/receipt:57)

其中 th:src 是th"元素的第一次出现.我不做任何自定义处理 - 只是一个带有很少百里香叶的 HTML 页面.页面被解析,因为当我有语法错误时,它告诉我 Thymeleaf 引擎无法解析页面.还要提一下,这个页面是由 MS Word 生成的,然后根据我的需要进行了调整.可以从头开始重写它,但我想找出什么不起作用以及为什么它总是给我这个消息.

where th:src is the first occurrence of a 'th' element. I don't do any custom processing - just an HTML page with a very little thymeleaf. The page gets parsed, as when I have errors in the syntax, it tells me that Thymeleaf engine failed to parse the page. Also to mention, this page was generated by MS Word and then adapted for my needs. It is possible to rewrite it from scratch, but I'd like to find out what is not working and why it keeps giving me this message anyway.

我的问题似乎与此论坛条目相同 http://forum.broadleafcommerce.org/viewtopic.php?f=14&t=1478(那个人没有得到答案).

MY problem seems to be identical to this forum entry http://forum.broadleafcommerce.org/viewtopic.php?f=14&t=1478 (the guy didn't get an answer).

提前致谢.

推荐答案

我发现这是因为在 Thymeleaf 模板引擎中添加了 datatables4j 方言.有问题的收据页面有一个没有用 datatables4j 符号标记的表格.它导致了问题中描述的错误.一旦我删除了方言,所有的 datatables4j 表都从任何地方消失了,但例外也是如此.

I figured out it was due to the datatables4j dialect added to the Thymeleaf template engine. The receipt page in question has a table that was not marked with the datatables4j notation. It led to the errors described in the question. As soon as I've removed the dialect, all the datatables4j tables were gone from everywhere, but so was the exception.

这篇关于解析 thymeleaf 模板时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆