Spring Property Injection Concepts

From NovaOrdis Knowledge Base
Revision as of 19:08, 21 November 2018 by Ovidiu (talk | contribs)
Jump to navigation Jump to search

Internal

Overview

This section refers to property injection, which is the process that allows external data to be provided to the application runtime at startup or while it is running, in form of properties, environment variables and other means. The component configuration, or bean wiring, is addressed in the "Dependency Injection and Inversion of Control Container Concepts - Configuration Model" section.

The Environment Abstraction

Injecting Properties into Beans

Property Injection and Auto-Configuration

Sources of Properties

Precedence

Profiles




Overview

application.properties

application.properties

Application Arguments

Environment Variables

Profile

TODO

  • How do I read the effective values of all configuration properties during testing and at runtime?
  • You can figure out the active profile from within a Spring application by @Autowire-ing org.springframework.core.env.Environment and inspecting it.