thymeleaf模板引擎

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

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

 

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

 

 

thymeleaf的语法:

在html中导入thymeleaf的命名空间

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

 

获取后端数据并展示

 

 

遍历取值 

 

posted @ 2020-02-19 14:37  Alan*Chen  阅读(124)  评论(0编辑  收藏  举报