Springboot根底 Day05
static文件夹与templates文件夹的区别
templates 里的资源须要tymleaf帮忙解析能力拜访
static 里的寄存的是动态资源能够间接拜访
利用 tymeleaf 在html中显示出数据
- @{门路/{变量名(变量名=${域名.办法名})
- th:each 展现一组数据
这是遍历的代码,能够参考
<tr th:each="g:${goods}">
<td th:text="${g.id}">1</td>
<td th:text="${g.name}">AAA</td>
<td th:text="${g.remark}">AAA</td>
<td th:text="${#dates.format(g.createdTime, 'yyyy/MM/dd HH:mm')}">2020/08/31</td>
<td><a href="#" th:href="@{/goods/doDeleteById/{id}(id=${g.id})}">delete</a></td>
<td><a href="#" th:href="@{/goods/doFindById/{id}(id=${g.id})}">update</a></td>
</tr>
发表回复