zoukankan      html  css  js  c++  java
  • springboot热更新

    在代码开发过程中 经常需要在不重启项目的情况下 动态更新代码或者配置文件

    下面我们来看看 具体应该怎么操作

    pom.xml

    <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-devtool</artifactId>
    </dependency>
    

     

    配置文件 application.properties

    server.port:8080
    url:http://localhost
    

      

    WebController

    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.core.env.Environment;
    import org.springframework.web.bind.annotation.RequestMapping;
    import org.springframework.web.bind.annotation.RestController;
    
    @RestController
    public class WebController {
        @Autowired
        private Environment env;
    
        @RequestMapping("/getUrl")
        public String test(){
            return env.getProperty("url");
        }
    
    }
    

     

    以这种方式同样可以更新代码

  • 相关阅读:
    安卓输入法
    android问题
    速查
    Iphone幻灯片效果+背景音乐
    MBProgressHUD使用
    画图
    textmate 的快捷键
    设置Table Cell的背景图的类
    Objectc 一些代码规范
    效果收集
  • 原文地址:https://www.cnblogs.com/lnas01/p/10351436.html
Copyright © 2011-2022 走看看