1、添加Thymeleaf依赖
![](https://img.haomeiwen.com/i13932133/a6652fe1306bee57.png)
在resources下面新建两个文件夹,分别是static、templatesresources下static⽂件夹存放images、css、js等静态资源templates存放Thymeleaf模板页面。
![](https://img.haomeiwen.com/i13932133/53057c830d89d4ae.png)
Controller层代码:
![](https://img.haomeiwen.com/i13932133/c547f2393345b2cd.png)
html⻚⾯头部添加thymeleaf名称空间声明:
![](https://img.haomeiwen.com/i13932133/e4c46a31d8dd012d.png)
1、添加Thymeleaf依赖
在resources下面新建两个文件夹,分别是static、templatesresources下static⽂件夹存放images、css、js等静态资源templates存放Thymeleaf模板页面。
Controller层代码:
html⻚⾯头部添加thymeleaf名称空间声明:
本文标题:如何学习Thymeleaf
本文链接:https://www.haomeiwen.com/subject/kivftqtx.html
网友评论