org.springframework.beans.factory.annotation.Value的@Value的默认值如何设置呢?
解决方法:
默认值方法@Value("${enableRedis:false}")
application.xml中:
enableRedis: true
代码注入enableRedis:
@Value("${bxCustomerProps.enableRedis:false}")
public void setEnableRedis(boolean isEnableRedis) {
enableRedis = isEnableRedis;
}
本文链接:http://www.yayihouse.com/yayishuwu/chapter/1465
向大家推荐《Activiti工作流实战教程》:https://xiaozhuanlan.com/activiti