通过注解@PropertiesSource  指定并读取配置文件中的数据

实例:

在Controller中 获取dingding.properties文件属性值: 

spring:注解:@PropertiesSource 读取配置文件中的数据

 Controller中的配置:

spring:注解:@PropertiesSource 读取配置文件中的数据

 

配置classpath:

spring:注解:@PropertiesSource 读取配置文件中的数据

相关文章:

  • 2021-06-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-17
  • 2022-12-23
  • 2021-09-23
猜你喜欢
  • 2022-02-08
  • 2022-12-23
  • 2021-11-29
  • 2021-07-24
  • 2022-02-20
  • 2021-07-02
  • 2021-05-11
相关资源
相似解决方案