SpringBoot整合Thymeleaf(上)
版权声明:本文为 小异常 原创文章,非商用自由转载-保持署名-注明出处,谢谢! 本文网址: https://blog.csdn.net/sun8112133/article/details/106961006 文章目录 一、引入 Thymeleaf 1、新建 Spring Boot 项目 2、引入依赖信息 3、创建 Controller,返回 Thymeleaf 视图 4、配置 application.yml 5、创建视图(result.html) 6、目录结构 7、测试 二、Thymeleaf 常用标签 1、th:text 2、th:utext 3、th:if 4、th:unless 5、th:switch 与 th:case 6、th:action 7、th:each 8、th:value 9、th:src 10、th:href 11、th:selected 12、th:attr 我在之前发布的 《Spring Boot 入门学习笔记》 中写过关于 Thymeleaf 模板引擎 的博客,在那篇博客中我简单介绍了 Thymeleaf 模板引擎 的使用以及个别标签。 在本篇博客中会主要介绍使用 Spring Boot 来整合 Thymeleaf 模板引擎 ,还有 Thymeleaf 模板引擎 常用标签,在下一篇博客中我会讲到 Thymeleaf 访问 Servlet Web