1.项目路径resource下都是存放静态资源,static可存放图片,templates则是存放html模板,模板修改之后需重启服务器才能生效

2.模板必须放在templates下并且引入,pom中引入
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
3.controller

本文介绍了Spring Boot5中HTML模板的配置和使用。内容包括:1) 静态资源路径说明,其中`static`用于存放图片,`templates`存放html模板,模板修改后需重启服务器;2) 引入Thymeleaf模板引擎的依赖;3) 控制器的相关操作。
1.项目路径resource下都是存放静态资源,static可存放图片,templates则是存放html模板,模板修改之后需重启服务器才能生效

2.模板必须放在templates下并且引入,pom中引入
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
3.controller

1931

被折叠的 条评论
为什么被折叠?