我正在尝试使用@ConditionalOnProperty. 当存在具有预定义前缀的任何属性时,应创建此配置。
例如,当存在以下列出的属性之一时,应创建此配置
test.property.any-text-goes-here.some-nested-property=test
test.property.nested.nested-two=another
我尝试使用@ConditionalOnPropertywith name=test.property,但它似乎不起作用。也许这可以使用 来解决@ConditionalOnExpression,但我不知道 SpEL 表达式应该是什么样子。
我想知道是否有一种方法可以在不需要实现 custom 的情况下实现这一点Condition。
谢谢你的帮助!