SpEL

Spriing boot stater中根据配置文件中的条件 生成相应的bean, 以适应不同场景

@ConditionalOnExpression中使用SpEl,  支持各种条件表达式

String的各种方法都能用,不限于等于、正则、以..开始、以..结束

 

参考

https://docs.spring.io/spring/docs/4.3.10.RELEASE/spring-framework-reference/html/expressions.html

https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-developing-auto-configuration.html#boot-features-spel-conditions

原文地址:https://www.cnblogs.com/yszzu/p/9836002.html