3

引用此链接后,我可以从 config/application/key1 下拉值

代码如下:

@SpringBootApplication
@EnableAutoConfiguration
@EnableDiscoveryClient
@RestController
@EnableConfigurationProperties
public class Application {

  @Autowired
  private Environment env;

  @RequestMapping("/")
  public String home() {
    return env.getProperty("keys");
  }

  public static void main(String[] args) {
    new SpringApplicationBuilder(Application.class).web(true).run(args);
  }

}
  • 但是,请问如何在(更深一层)key1的路径中访问价值?config/application/keys/key1
  • 而如果出现了and之类的重复,config/application.key1config/software/key1该如何选择下拉哪一个呢?
4

0 回答 0