1  通过@ConfigurationProperties 读取  读取key 为 service-test.ip =***, service-test.host=****

Springboot 读取properties

2 @Value 读取

Springboot 读取properties

3 通过注入 Environment 可以获取所有的环境变量 包括jvm

Springboot 读取properties

4 使用PropertiesLoaderUtils 方式 通过注册监听器的方式

相关文章:

  • 2021-09-21
  • 2021-07-15
  • 2021-07-27
  • 2022-12-23
  • 2022-02-08
  • 2021-09-07
  • 2022-03-03
  • 2021-07-21
猜你喜欢
  • 2022-02-08
  • 2022-01-13
  • 2022-02-08
  • 2021-12-17
  • 2021-11-11
  • 2022-02-08
相关资源
相似解决方案