springboot中如何使用thymeleaf生成静态页面

2024-10-13 09:22:14

1、首先加入spring-boot-starter-thymeleaf依赖。

springboot中如何使用thymeleaf生成静态页面

3、下面是模板文件位置:

springboot中如何使用thymeleaf生成静态页面

5、启动run方法,查看日志,如下:可以看到已完成静态文件生成。

springboot中如何使用thymeleaf生成静态页面

7、打开html文件可以看到,正是我们需要的静态文件。

springboot中如何使用thymeleaf生成静态页面
猜你喜欢