java - Spring PropertySourcesPlaceholderConfigurer: local properties vs environment ones? -
I'm trying to use PropertySourcesPlaceholderConfigurer
. However, I am confused with the concepts of "local property" and "environment property", as in Spring API Javadoc:
The search priority of the local properties is based on the value of the local override property, which The default is the false meaning that local properties are finally being searched after all environmental property sources.
For example, what is a local property? What is the property of the environment? How are they defined in the code? What is the logic behind the separation of both?
Thank you very much.
Environmental properties are properties from the environment :). The properties that you can get are
System.getenv () System.getProperties ()
Spring registers both of them and lets them Provides
C.setLocation (new classpath resource ("/ some.properties"));
Remember you will use localoverride
to determine the properties in your local properties with the same key, remember property, PropertySource
objects are stored in Spring will be repeated through all registered PropertySource
objects and this will return the first asset for the key you provided.
Comments
Post a Comment