properties配置文件如何使用SpringBoot进行读取-创新互联
这篇文章给大家介绍properties配置文件如何使用Spring Boot进行读取,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。
在SpringApplication类中:
private ConfigurableEnvironment prepareEnvironment( SpringApplicationRunListeners listeners, ApplicationArguments applicationArguments) { // Create and configure the environment ConfigurableEnvironment environment = getOrCreateEnvironment(); configureEnvironment(environment, applicationArguments.getSourceArgs()); //此处读取 listeners.environmentPrepared(environment); if (isWebEnvironment(environment) && this.webApplicationType == WebApplicationType.NONE) { environment = convertToStandardEnvironment(environment); } return environment; }
分享文章:properties配置文件如何使用SpringBoot进行读取-创新互联
分享URL:http://azwzsj.com/article/dipsep.html