美文网首页
六、Thymeleaf完整集成到SpringBoot

六、Thymeleaf完整集成到SpringBoot

作者: joy_蓝蜘蛛 | 来源:发表于2018-05-22 19:05 被阅读42次

第一步:在项目的pom.xml文件中加入包引用

加入引用包

第二步:在资源文件中新建文件夹templates

新建文件夹templates

因为Thymeleaf引擎默认路径就是在资源文件的templates目录下面

第三步:在项目包下面建控制类

新建控制类

这里返回2个属性键值对给页面,name和sex

第四步:在资源文件的templates下面新建页面index.html

这样就可以使用模版引擎了


image.png

更多Thymeleaf的语法请看下面资源:

官方资料:https://www.thymeleaf.org/documentation.html
其它资料1:https://blog.csdn.net/u014042066/article/details/75614906
其它资料2https://www.cnblogs.com/summercanon/p/7910799.html

相关文章

网友评论

      本文标题:六、Thymeleaf完整集成到SpringBoot

      本文链接:https://www.haomeiwen.com/subject/kmykjftx.html