标签: spring spring-boot properties key-value spring-properties
我想在缺少值和没有值的当前属性之间进行区分,例如 key=。在两种情况下,注释@Value("${key}")都会引发IllegalArgumentException Could not resolve placeholder 'key' in value "${key}"。
key=
@Value("${key}")
IllegalArgumentException
Could not resolve placeholder 'key' in value "${key}"