thymeleaf模板引擎

Springboot需要使用thymeleaf模板引擎来编写前端页面,代替了SSM中的JSP

controller的return页面的路径,默认为resources下的template

查看thymeleaf的配置文件,在template下默认使用.html页面

thymeleaf的语法:

在html中导入thymeleaf的命名空间

xmlns:th="http://www.thymeleaf.org"

获取后端数据并展示

 

遍历取值 

原文地址:https://www.cnblogs.com/alanchenjh/p/12331206.html