springBoot 获取配置文件配置内容

配置文件:application.properties

import org.springframework.core.env.Environment;



    /** 获取properties 配置文件 */
    @Autowired  
    private  Environment env;  



    private void  doInitParam(){
        this.port= env.getProperty("server.port");
    }
    

猜你喜欢

转载自blog.csdn.net/liyongbing1122/article/details/80324061