SpringBoot(二)thymeleaf模板的引入

接着上一次的配置

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的。

猜你喜欢

转载自www.cnblogs.com/zhaomin08240115/p/9145925.html
今日推荐