引用此链接后,我可以从 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.key1
我config/software/key1
该如何选择下拉哪一个呢?