Spring 如何向thymeleaf添加图像
如何将templates/image/valyaev.png文件夹中的图像添加到thymeleaf,请使用多个选项,但图像本身不会显示,只会显示图像的轮廓或只显示一个勾号Spring 如何向thymeleaf添加图像,spring,thymeleaf,Spring,Thymeleaf,如何将templates/image/valyaev.png文件夹中的图像添加到thymeleaf,请使用多个选项,但图像本身不会显示,只会显示图像的轮廓或只显示一个勾号 我可以使用addInline添加它,但我无法对图像执行任何操作,因此我想通过thymeleaf本身添加,为什么不将其复制到路径static/images中,然后使用以下语句: <img th:src="@{/images/valayev.jpg}" 有时thymeleaf不采用静态映像路径,在这种情况下,使用该映
我可以使用addInline添加它,但我无法对图像执行任何操作,因此我想通过thymeleaf本身添加,为什么不将其复制到路径static/images中,然后使用以下语句:
<img
th:src="@{/images/valayev.jpg}"
有时thymeleaf不采用静态映像路径,在这种情况下,使用该映像的基64
<img th:src="@{data:image/png;base64,YOUR IMAGE BASE 64}
如果将其添加到static,需要设置路径@{/static/images/valayev.jpg}?那有什么不同呢?不,用上面的陈述就行了。它会自动在静态文件夹中查找图像文件夹。不管怎样,图像属于“静态”的。