1. thymeleaf运行之后就是纯HTML了,没运行之前也是纯HTML,这一点不同于JSP,jsp要解析成servlet等操作。
2. thymeleaf 不需要服务端的支持,前端人员可以直接的调试。
3. 页面标题要改为:
<html xmlns:th="http://www.thymeleaf.org">
4. application.properties配置文件
#thymeleaf 配置
spring.thymeleaf.mode=HTML5
spring.thymeleaf.encoding=UTF-8
spring.thymeleaf.content-type=text/html
#缓存设置为false, 这样修改之后马上生效,便于调试
spring.thymeleaf.cache=false
#上下文
server.context-path=/thymeleaf
5. maven要增加依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
6. 建立存放页面的文件夹。之前的jsp页面在webapp下的jsp下。
<