@Value注解

@Value("${name:default}")
public String name;
当配置文件中key没有name时,默认使用default
posted @ 2022-12-20 09:32  疯靡  阅读(26)  评论(0)    收藏  举报