未能呈现 B64 编码的 Thymeleaf
Failure to render B64encoded Thymeleaf
我在这里和整个 Internet 上搜索了很多小时,但无法在对象中呈现正确的 B64 编码图像。我已经尝试了变音符号的每一种排列,但什么都没有。谁能告知正确的
<tr th:each="re:${reorderList}">
<td th:text="${re.invoiceNum}"></td>
<td th:text="${re.ordered}"></td>
<td th:text="${re.shipped}"></td>
<td th:text="${re.sku}"></td>
<td ><img th:src="${'data:image/jpg;base64,'+ re.upc_s" ></td>
<td th:text="${re.upc01_s}"></td>
<td th:text="${re.brand}"></td>
<td th:text="${re.desc}"></td>
<td th:text="${re.stdCost}"></td>
</tr>
您在 <img />
标签的 th:src
属性中缺少结束花括号。表达式应为:
th:src="${'data:image/jpg;base64,'+ re.upc_s}"
我个人表示为:
<img th:src="|data:image/jpg;base64, ${re.upc_s}|" />
我在这里和整个 Internet 上搜索了很多小时,但无法在对象中呈现正确的 B64 编码图像。我已经尝试了变音符号的每一种排列,但什么都没有。谁能告知正确的
<tr th:each="re:${reorderList}">
<td th:text="${re.invoiceNum}"></td>
<td th:text="${re.ordered}"></td>
<td th:text="${re.shipped}"></td>
<td th:text="${re.sku}"></td>
<td ><img th:src="${'data:image/jpg;base64,'+ re.upc_s" ></td>
<td th:text="${re.upc01_s}"></td>
<td th:text="${re.brand}"></td>
<td th:text="${re.desc}"></td>
<td th:text="${re.stdCost}"></td>
</tr>
您在 <img />
标签的 th:src
属性中缺少结束花括号。表达式应为:
th:src="${'data:image/jpg;base64,'+ re.upc_s}"
我个人表示为:
<img th:src="|data:image/jpg;base64, ${re.upc_s}|" />