@ConfigurationProperties: Difference between revisions
Jump to navigation
Jump to search
(Created page with "=Internal= * Spring Property Injection Concepts =Overview= @ConfigurationProperties is an annotation...") |
No edit summary |
||
Line 6: | Line 6: | ||
@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_Property_Injection_Concepts#The_Environment_Abstraction|Spring environment]]. | @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_Property_Injection_Concepts#The_Environment_Abstraction|Spring environment]]. | ||
<syntaxhighlight lang='java'> | |||
@Component | |||
@ConfigurationProperties(prefix = "playground.spring.pi") | |||
public class ... { | |||
} | |||
</syntaxhighlight> | |||
The prefix attribute defines the namespace for the configuration properties exposed by the component. |
Revision as of 22:01, 21 November 2018
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.