@Value("${layer1.layer2.userName}")
private String userName
userName变量就获取了yml配置文件中的值
本文介绍如何在代码中通过注解方式读取YML配置文件中的值,使用@Value注解将配置文件中的特定属性值注入到变量中。
@Value("${layer1.layer2.userName}")
private String userName
userName变量就获取了yml配置文件中的值
9万+

被折叠的 条评论
为什么被折叠?