企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
`${ }`为占位符。`.properties`和`.yml`都支持占位符写法。 ```properties student.name=zhangsan # 可以获取随机数 student.age = ${random.int} # 获取上面已经有的属性值 student.last.name=${student.name} # 提供默认值,当没有student.sex时,默认为manhuman student.gender=${student.sex:man}human ``` ```java /** 其实对注解属性赋值也可以采用占位符写法 **/ //当配置文件中没有student.name时,则默认值为张三 @Value("${student.name:张三") ```