springboot项目,后端从数据库获取到数据集合返回前端页面,在页面中对数据进行遍历显示
代码实现:
springboot一般集成thymeleaf模板引擎对集合数据进行展示渲染
导入springboot集成thymeleaf的两个依赖(这里用的是springboot父版本)
org.thymeleaf thymeleaf-spring5org.thymeleaf.extras thymeleaf-extras-java8time
页面编写
相关代码
遍历集合数据
| 序号 | 部门id | 部门名称 | 数据库 |
|---|---|---|---|
效果图



