@ConfigurationProperties: Difference between revisions

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


* [[Spring_Property_Injection_Concepts#Injecting_Properties_into_Beans|Spring Property Injection Concepts]]
* [[Spring_Boot_Property_Injection#.40ConfigurationProperties|Spring Boot Property Injection]]


=Overview=
=Overview=

Revision as of 04:39, 6 December 2018

External

Internal

Overview

@ConfigurationProperties is an annotation that, once placed on a bean, specifies that the properties of that bean ban be injected from properties present in the Spring environment.

@Component
@ConfigurationProperties(prefix = "playground.spring.pi")
public class ... {
}

The 'prefix' attribute defines the namespace for the configuration properties exposed by the component.