Spring Property Injection Concepts: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
No edit summary
No edit summary
Line 5: Line 5:
=Overview=
=Overview=


This section refers to external data that is provided to the application in form of properties or environment variables, and which can potentially modify the behavior of the application. The component configuration is addressed in the "[[Spring_Dependency_Injection_and_Inversion_of_Control_Container_Concepts#Configuration_Model|Dependency Injection and Inversion of Control Container Concepts - Configuration Model]]" section.
This section refers to '''property injection''', or the process through which external data that is provided to the application runtime at startup or while it is running, in form of properties, environment variables and other means, and which can potentially modify the behavior of the application. The component configuration, or bean wiring, is addressed in the "[[Spring_Dependency_Injection_and_Inversion_of_Control_Container_Concepts#Configuration_Model|Dependency Injection and Inversion of Control Container Concepts - Configuration Model]]" section.
 


=The Environment Abstraction=
=The Environment Abstraction=

Revision as of 19:07, 21 November 2018

Internal

Overview

This section refers to property injection, or the process through which external data that is provided to the application runtime at startup or while it is running, in form of properties, environment variables and other means, and which can potentially modify the behavior of the application. 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.