- 页面热部署实现
- application.properties配置如下:
#thymeleaf start spring.thymeleaf.mode=HTML5 spring.thymeleaf.encoding=UTF-8 spring.thymeleaf.content-type=text/html #开发时关闭缓存,不然没法看到实时页面 spring.thymeleaf.cache=false #thymeleaf end - Ctrl + F9 build project
- 代码热部署实现
- CTRL + SHIFT + A --> 查找make project automatically --> 选中
- 加maven依赖
<dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-devtools</artifactId> <optional>true</optional> </dependency> - 开启热部署
<build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration> <fork>true</fork> </configuration> </plugin> </plugins> </build> - Ctrl + F9 build project
本文介绍如何通过配置Spring Boot项目的application.properties文件实现Thymeleaf模板引擎的页面热部署,并利用spring-boot-devtools实现代码修改后的自动热部署,提高开发效率。
5173

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



