SpringBoot学习(四)——配置文件占位符

RandomValuePropertySource:配置文件中可以使用随机数

  ${Random.value}  ${random.int}, ${random.long}, ${random.int(10)}, ${random.int[1024,65536]}

属性配置占位符

  app.name=MyApp

  app.description=${app.name} is application

  可以在配置文件中引用前面配置过的属性

  ${app.name:默认值}来指定找不到属性时候的默认值

猜你喜欢

转载自www.cnblogs.com/zhilili/p/12376498.html