2-7节配javaPropertyValue 值怎么设置为Mercy的,视频中怎么没看到,我本地的javaPropertyValue值默认是null
来源:2-9 基于编程方式实现条件装配

慕码人232225
2018-09-06
public class OnSystemPropertyCondition implements Condition {
@Override
public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata) {
Map<String, Object> attributes = metadata.
getAnnotationAttributes(ConditionalOnSystemProperty.class.getName());
String propertyName = String.valueOf(attributes.get("name"));
String propertyValue = String.valueOf(attributes.get("value"));
String javaPropertyValue = System.getProperty(propertyName);
return propertyValue.equals(javaPropertyValue);
}
}
这里的javaPropertyValue 值怎么设置为Mercy的,视频中怎么没看到,我本地的javaPropertyValue值默认是null
写回答
3回答
-
此间道
2020-03-18
这些都是自己环境的系统变量,可以把 System.getProperties()的返回值遍历,看看都有哪些系统设置
00 -
黑车轴
2018-12-20
如题,,我也遇到了同样的问题!
00 -
泡沫鱼
2018-09-17
系统变量, 你设置一下就好了
012018-12-20
相似问题