Spring Boot SpEL ConditionalOnExpression check multiple properties

后端 未结 2 1114
轻奢々
轻奢々 2020-12-05 16:13

Question:

How can I use Spring Expression Language to check that 2 Boolean properties are true?

For example, checking that a single

2条回答
  •  一个人的身影
    2020-12-05 16:33

    As far as i remember, You could use this kind of expression:

    @ConditionalOnExpression("'${com.property1}'.equals('${com.property2}')")
    

    for further reading here is the link

    if it was helpful, please do comment so that my confusion may also get cleared.

提交回复
热议问题