关于springboot:SPRINGBOOT基础05

0次阅读

共计 518 个字符,预计需要花费 2 分钟才能阅读完成。

Springboot 根底 Day05

static 文件夹与 templates 文件夹的区别

templates 里的资源须要 tymleaf 帮忙解析能力拜访
static 里的寄存的是动态资源能够间接拜访

利用 tymeleaf 在 html 中显示出数据

  1. @{门路 /{ 变量名 ( 变量名 =${ 域名. 办法名})
  2. 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>
正文完
 0