导入相关依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>org.thymeleaf</groupId>
<artifactId>thymeleaf-spring5</artifactId>
</dependency>
<dependency>
<groupId>org.thymeleaf.extras</groupId>
<artifactId>thymeleaf-extras-java8time</artifactId>
</dependency>

ThymeleafProperties 配置类
1.默认编码
2.前缀
3.后缀
相当于视图解析器
文章介绍了在SpringBoot项目中使用Thymeleaf模板引擎的基本配置,包括添加依赖、ThymeleafProperties的配置以及如何通过@Controller和@RequestMapping处理视图渲染。还提到前端与后端交互时的参数传递和配置细节。
订阅专栏 解锁全文
2724

被折叠的 条评论
为什么被折叠?



