thymeleaf中不能读取图片资源地址

源代码中显示

<img th:src="@{/images/123.jpg}" alt="" class="ui avatar image">

没有把里面的@{}里面的资源读取出来

这是怎么回事

 

后来发现好像是thymeleaf没起作用,我换代码块在浏览器中还是一样的

https://blog.csdn.net/chenbetter1996/article/details/84994801 解决了

https://blog.csdn.net/chenbetter1996/article/details/84994801

参考一下

https://blog.csdn.net/cookie_turbo/article/details/103434399

thymeleaf jar包和 页面的头文件都引入了嘛 检查下

你检查一下相应的页面是否导入

<html lang="en" xmlns:th="http://www.thymeleaf.org">

还有检查你的项目是否有thymleaf的依赖

 <!--thymeleaf 模板引擎-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>
最后还不行你就用html的静态引用吧,也是一样的
<img src="../static/images/g2.jpg"  th:src="@{/images/g2.jpg}" alt="" class="img-responsive zoom-img"/>