- 博客(1)
- 收藏
- 关注
原创 spring注解--@Value注解
在Spring框架中,@Value注解用于将外部配置文件中的值注入到Spring管理的Bean的属性中。这里`${my.property}`表示从外部配置文件中读取名为`my.property`的属性值并将其注入到`myProperty`字段中。这里的`:default`表示如果在外部配置文件中找不到名为`my.property`的属性值,则使用默认值`default`。类似地,`${my.list}`表示从外部配置文件中读取名为`my.list`的属性值,并将其解析为列表。
2024-03-12 21:39:33
249
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人