SPRING CONCEPTS

Property values and sources

Spring Concepts / Property values and sources

A property source contributes configuration values that beans can read.

Understand the idea

Value resolves a placeholder such as ${catalog.heading:Products}. PropertySource explicitly adds a properties file to the Environment. Boot loads its conventional application properties and YAML through its configuration-data support. A Framework-only context does not automatically perform that Boot loading, and default PropertySource support does not parse YAML.

A concrete example

@Value("${catalog.heading:Products}") String heading

In the application

See the independently runnable examples in Stage 24, Stage 25.

Configuration comes from the running application environment, not from Java field names.

See it in a working stage

Related concepts

Read the official documentation ↗
Java 21 · Spring Boot 4.1.1 · Edupoly