Skip to content

Latest commit

 

History

History
22 lines (13 loc) · 885 Bytes

Spring_Configuration_and_Profile.md

File metadata and controls

22 lines (13 loc) · 885 Bytes

Spring Externalized Configuration

Spring Profile:

Spring Expression Language (SpEL)

example: @Value("#{'${xxx.xxx}'=='sandbox' ? '${xxx.sandbox}' : '${xxx.production}'}") //With #{} it is an expression, with ${} it is a placeholder for a value

@ConditionalOnExpression("'${server.host}'=='localhost'") // can't apply to field

How to do conditional auto-wiring in Spring?