springboot thymeleaf eclipse热部署方案
2017-07-04 16:29
369 查看
网上找了好多的springboot热部署方案,也尝试了好几种方法,下面是我的成功方案跟大家分享
操作步骤
1.pom中添加热部署依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
2.添加插件
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
3.controller中添加后台跳转
@RequestMapping(value = "/index",method = RequestMethod.GET)
public String hello(Model model) {
model.addAttribute("name", "Dear");
return "index";
}
4.index.html
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>神州泰岳征信系统</title>
</head>
<body>helloword!
<p th:text="'Hello!, ' + ${name} + '!'" >3333</p>
测试热部署1111111
</body>
</html>
5. thymeleaf:
mode: HTML5
encoding: UTF-8
content-type: text/html
#开发时关闭缓存,不然没法看到实时页面
cache: false
cache-period: 0
template:
cache: false
6.开启自动编译功能
6.进行测试
操作步骤
1.pom中添加热部署依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
2.添加插件
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<fork>true</fork>
</configuration>
3.controller中添加后台跳转
@RequestMapping(value = "/index",method = RequestMethod.GET)
public String hello(Model model) {
model.addAttribute("name", "Dear");
return "index";
}
4.index.html
<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>神州泰岳征信系统</title>
</head>
<body>helloword!
<p th:text="'Hello!, ' + ${name} + '!'" >3333</p>
测试热部署1111111
</body>
</html>
5. thymeleaf:
mode: HTML5
encoding: UTF-8
content-type: text/html
#开发时关闭缓存,不然没法看到实时页面
cache: false
cache-period: 0
template:
cache: false
6.开启自动编译功能
6.进行测试
相关文章推荐
- spring boot 自动部署方案
- [置顶] Eclipse新建Spring-boot项目,打包部署并输出HelloWord
- springboot模板方案thymeleaf和freemarker之比较
- Eclipse Spring Boot实现热部署
- spring boot Thymeleaf 页面包含和页面热部署
- spring boot部署中一个斜杠引发的血案--org.thymeleaf.exceptions.TemplateInputException
- SpringBoot Eclipse部署到tomcat
- 如何在openshift上diy部署spring-boot并在本地用eclipse开发
- Ideal+spring boot+thymeleaf 的热部署问题处理
- Jenkins spring boot 自动部署方案
- Spring Boot项目部署到Eclipse下的tomcat
- Springboot基于assembly的服务化打包方案及spring boot部署方式
- Eclipse SpringBoot jsp打包部署
- 通过eclipse把spring boot项目打包成war包并部署到tomcat服务器上的步骤
- SpringBoot在Eclipse内能够运行,但是部署在Tomcat8上启动时会有一个logback的异常
- springboot 多环境(开发、测试、生产)部署配置文件方案
- spring-boot下热部署热启动方案测试汇总
- SpringBoot配置devtools实现热部署(eclipse和idea)
- spring boot 自动部署方案
- springboot eclipse 热部署