在日常开发中模板一般来说是这四种:
JSP、Velocity、Freemarker、Thymelea
但在springboot中推荐的模板是thymeleaf(语法更简单,功能更强大)
使用thymeleaf第一步(配置):
在pom.xml导入:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
2.1.6
</dependency>
<!--切换thymeleaf版本-->
<properties>
<project.build.sorucesEncoding>UTF-8</project.build.sorucesEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<java.version>