1
在Spring Boot應用程序中,我嘗試使用命名空間設置屬性。下面是我的嘗試:Thymeleaf:使用命名空間設置屬性
<svg id="svg1" width="100%" viewBox="0 0 400 100" xmlns="http://www.w3.org/2000/svg"
xmlns:th="http://www.thymeleaf.org"
xmlns:xlink="http://www.w3.org/1999/xlink">
...
<image th:attr="x=${thumbx},xlink:href=${thumbfile}"
x="150" y="50" width="20" height="20"
xlink:href="http://s3.amazonaws.com/some.png"/>
...
</svg>
這就引出了org.thymeleaf.exceptions.TemplateProcessingException:無法解析爲分配序列: 「X = $ {} THUMBX,XLink的:HREF = $ {} thumbfile」。
有關如何設置屬性xlink:href的任何想法?
就是這樣,謝謝! – ratlan