新建项目的时候选择你需要的模板引擎
在xml文件中就会生成配置文件
模板引擎的配置:
#Thymeleaf模板引擎配置 #前缀 #spring.thymeleaf.prefix=classpath:/templates/ #后缀 #spring.thymeleaf.suffix=html #缓存 开发环境建议设置为false 生产环境建议设置为true spring.thymeleaf.cache=false #模板文件编码 #spring.thymeleaf.encoding=UTF-8
controller文件
接收后台传过来的数据一般用:th:
html页面接收数据:
页面显示效果:
遍历:th:each
html页面foreach接收数据:
none:
text:
css:
javascript:



