在前端标签上加上thymeleaf的代码后前端样式不展示

在前端标签上加上thymeleaf的代码后前端样式不展示

引入了springboot的依赖

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
        </dependency>

与html命名空间

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

页面原本能展示,但是如果加上了thymeleaf的语法

img

比如从

                        <li class="yui3">
                            <div class="list-wrap">
                                <div class="p-img">
                                    <img src="/img/_/mobile02.png" />
                                </div>
                        </li>

(代码只截取了一部分)

加上th:each变成

<li class="yui3" th:each="goods:${goodsList}">
                            <div class="list-wrap">
                                <div class="p-img">
                                    <img src="/img/_/mobile02.png" />
                                </div>
                        </li>

那么原本可以展示的li标签部分会直接变成一片空白什么也不展示

img

img

打开F12发现是thymeleaf无法加载
rebuild过和重新打包都无法成功引用

请问该怎么解决呢

应该不是thymeleaf无法加载的原因,我这个界面上引入了thymeleaf,如下:

img


可是按电脑F12发现当前界面并没有显示引入thymeleaf

img


我想应该是goodsList这个长度为0导致的吧!