图像不加载百里角
我正在尝试使用Thymeleaf的电子邮件中加载项目本地存储的图像,但不会!
<img src="../static/img/logo.png" alt="MyPicture" th:src="@{img/logo.png}">
虽然当我尝试使用绝对路径时,它完美地加载
<img src="C:/Workspace/myProject/src/main/resources/static/img/logo.png" alt="MyPicture">
了我的图像,以static/img
I'm trying to load an image from my project's local storage in email with Thymeleaf but it won't !
<img src="../static/img/logo.png" alt="MyPicture" th:src="@{img/logo.png}">
although when I try with an absolute path it's perfectly loading
<img src="C:/Workspace/myProject/src/main/resources/static/img/logo.png" alt="MyPicture">
My images are stored in static/img
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
图像路径应以前向斜线为开始
The image path shall start with a forward slash like
尝试更改您的路径
,您可能还希望从IDE设置中的缓存无效以检测到图像
try changing your path to
and you might also want to invalidate cache from your IDE settings for the image to be detected