第三天: 使用Themeleaf模板引擎渲染web视图

第一天介绍了使用springboot返回jsp视图,今天学习使用Themeleaf模板.

1接口:

第三天: 使用Themeleaf模板引擎渲染web视图

地址:http://http://localhost:8080/leaf

2模板

在resources目录下的templates新建xxx.html

第三天: 使用Themeleaf模板引擎渲染web视图

3 配置pom.xml

在dependencies节点添加denpendency

<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>

4 查看效果

第三天: 使用Themeleaf模板引擎渲染web视图