Skip to content

Commit c9a09cf

Browse files
committed
Clarify when SpEL expressions in application properties are evaluated
Closes gh-24531
1 parent 1db271c commit c9a09cf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1612,7 +1612,9 @@ If you used `@Value("{demo.itemPrice}")` instead, `demo.item-price` and `DEMO_IT
16121612
If you define a set of configuration keys for your own components, we recommend you group them in a POJO annotated with `@ConfigurationProperties`.
16131613
Doing so will provide you with structured, type-safe object that you can inject into your own beans.
16141614

1615-
While you can write a `SpEL` expression in `@Value`, such expressions are not processed from <<boot-features-external-config-application-property-files,application property files>>.
1615+
`SpEL` expressions from <<boot-features-external-config-application-property-files,application property files>> are not processed at time of parsing these files and populating the environment.
1616+
However, it is possible to write a `SpEL` expression in `@Value`.
1617+
If the value of a property from an application property file is a `SpEL` expression, it will be evaluated when consumed via `@Value`.
16161618

16171619

16181620

0 commit comments

Comments
 (0)