接着上一次的配置
1.在pom文件中添加thymeleaf模板的引入,
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
位置如图:

2.在templates包下新建hello.html文件

3.在HelloController中添加,如图

启动项目后,访问:http://localhost:8080/zm/hello

总结:只是简单的配置,没有深入,再下一节深入了解一下,thhymeleaf是可以替代jsp的。
浙公网安备 33010602011771号