From c9a09cf6a9d45f2757e6607cca57c0cf764c3c71 Mon Sep 17 00:00:00 2001 From: Madhura Bhave Date: Fri, 18 Dec 2020 14:15:27 -0800 Subject: [PATCH] Clarify when SpEL expressions in application properties are evaluated Closes gh-24531 --- .../src/docs/asciidoc/spring-boot-features.adoc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc index 57ab4ef97b..1710846544 100644 --- a/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc +++ b/spring-boot-project/spring-boot-docs/src/docs/asciidoc/spring-boot-features.adoc @@ -1612,7 +1612,9 @@ If you used `@Value("{demo.itemPrice}")` instead, `demo.item-price` and `DEMO_IT If you define a set of configuration keys for your own components, we recommend you group them in a POJO annotated with `@ConfigurationProperties`. Doing so will provide you with structured, type-safe object that you can inject into your own beans. -While you can write a `SpEL` expression in `@Value`, such expressions are not processed from <>. +`SpEL` expressions from <> are not processed at time of parsing these files and populating the environment. +However, it is possible to write a `SpEL` expression in `@Value`. +If the value of a property from an application property file is a `SpEL` expression, it will be evaluated when consumed via `@Value`.