Skip to content

Commit 84cee76

Browse files
committed
Merge branch '2.2.x' into 2.3.x
Closes gh-24032
2 parents e83f3f4 + d5980be commit 84cee76

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

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

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1300,9 +1300,6 @@ To convert a property name in the canonical-form to an environment variable name
13001300

13011301
For example, the configuration property `spring.main.log-startup-info` would be an environment variable named `SPRING_MAIN_LOGSTARTUPINFO`.
13021302

1303-
NOTE: Underscores cannot be used to replace the dashes in property names.
1304-
If you attempt to use `SPRING_MAIN_LOG_STARTUP_INFO` with the example above, no value will be bound.
1305-
13061303
Environment variables can also be used when binding to object lists.
13071304
To bind to a `List`, the element number should be surrounded with underscores in the variable name.
13081305

@@ -1596,7 +1593,7 @@ The following table summarizes the features that are supported by `@Configuratio
15961593

15971594
| <<boot-features-external-config-relaxed-binding,Relaxed binding>>
15981595
| Yes
1599-
| Limited (see note below)
1596+
| Limited (see <<boot-features-external-config-vs-value-note,note below>>)
16001597

16011598
| <<appendix-configuration-metadata.adoc#configuration-metadata,Meta-data support>>
16021599
| Yes
@@ -1607,15 +1604,15 @@ The following table summarizes the features that are supported by `@Configuratio
16071604
| Yes
16081605
|===
16091606

1610-
If you define a set of configuration keys for your own components, we recommend you group them in a POJO annotated with `@ConfigurationProperties`.
1611-
Doing so will provide you with structured, type-safe object that you can inject into your own beans.
1612-
1613-
If you do want to use `@Value`, we recommend that you refer to property names using their canonical form (kebab-case using only lowercase letters).
1607+
NOTE: [[boot-features-external-config-vs-value-note]] If you do want to use `@Value`, we recommend that you refer to property names using their canonical form (kebab-case using only lowercase letters).
16141608
This will allow Spring Boot to use the same logic as it does when relaxed binding `@ConfigurationProperties`.
16151609
For example, `@Value("{demo.item-price}")` will pick up `demo.item-price` and `demo.itemPrice` forms from the `application.properties` file, as well as `DEMO_ITEMPRICE` from the system environment.
16161610
If you used `@Value("{demo.itemPrice}")` instead, `demo.item-price` and `DEMO_ITEMPRICE` would not be considered.
16171611

1618-
Finally, 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>>.
1612+
If you define a set of configuration keys for your own components, we recommend you group them in a POJO annotated with `@ConfigurationProperties`.
1613+
Doing so will provide you with structured, type-safe object that you can inject into your own beans.
1614+
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>>.
16191616

16201617

16211618

0 commit comments

Comments
 (0)