【发布时间】:2019-05-17 01:41:51
【问题描述】:
我想使用 thymeleaf th:each 在 li 标签中显示图像。 我试图将数字的变量值输入到图像 src 中,但没有显示图像。 如何thymeleaf th:each number variable input image src?
试试代码:
<th:block th:each="num: ${#numbers.sequence(1,22)}">
<li>
<img th:src="@{/images/sub/logo/company + ${num} + .jpg}">
</li>
</th:block>
and
<li th:each="num: ${#numbers.sequence(1,22)}">
<img th:src="@{/images/sub/logo/company + ${num} + .jpg}">
</li>
错误: http://localhost:8090/****/images/sub/logo/company%20+%20$%7Bnum%7D%20+%20.jpg
【问题讨论】:
标签: thymeleaf