【发布时间】:2018-04-08 03:51:43
【问题描述】:
我正在尝试使用@ConditionalOnExpression("not ${service.synchronous} && not ${service.disabled}") 有条件地创建一个组件。
我基于Spring Boot SpEL ConditionalOnExpression check multiple properties,它提供了一个多属性条件如下:@ConditionalOnExpression("${properties.first.property.enable:true} && ${properties.second.property.startServer:false}")
但是,我不断得到:
Caused by: org.springframework.expression.spel.SpelParseException: EL1041E: After parsing a valid expression, there is still more data in the expression: 'lcurly({)'
这些属性总是在我的 .properties 文件中设置,所以我没有使用冒号表示法提供默认值。我做错了什么?
【问题讨论】: