这是模板。
从 TemplateEngine 运行处理函数后,我收到此错误 org.thymeleaf.exceptions.TemplateProcessingException: Could not parse as allocatesequence: "data=http://www.somesite.com"(template : "someFile.html"- 第 5 行,第 2 栏)
我尝试了几种不同的方法,但始终得到相同的结果。
<div class="someClass" th:id="${divId}">
<object class="someClass" type="application/pdf"
th:data="'|${url}|'">
<p>You don't have a PDF plugin for this browser.
<a th:href="@{|${url}|}">
Click here to download PDF file.
</a>
</p>
</object>
</div>
最佳答案
当 th: 需要一个表达式
时,您正试图将一个字符串
传递给它。
更改此:
th:data="'|${url}|'"
对此:
th:data=${url}
记住更改其他也是字符串的元素。
关于java - Thymeleaf 模板 :data=http://www. somesite.com || org.thymeleaf.exceptions.TemplateProcessingException:无法解析为分配序列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58562512/