Add note on precedence rules for PropertyFileVariableSource
This commit is contained in:
@@ -5091,8 +5091,9 @@ joan_age=35</programlisting>
|
||||
<literal>${joan_age}</literal> variables in your object definitions
|
||||
if you configure the following variable source:</para>
|
||||
|
||||
<para><programlisting><object type="Spring.Objects.Factory.Config.PropertyFileVariableSource, Spring.Core">
|
||||
<property name="Location" value="~\application.properties" />
|
||||
<para><programlisting language="myxml"><object type="Spring.Objects.Factory.Config.PropertyFileVariableSource, Spring.Core">
|
||||
<property name="Location" value="~\application.properties" /> <!-- specify a single ... -->
|
||||
<property name="Locations" value="~\file1.properties,~\file2.properties" /> <!-- or multiple locations -->
|
||||
<property name="IgnoreMissingResources" value="true"/>
|
||||
</object></programlisting></para>
|
||||
|
||||
@@ -5103,12 +5104,22 @@ joan_age=35</programlisting>
|
||||
the next variable source(s) of the
|
||||
<literal>VariablePlaceholderConfigurer</literal>.</para>
|
||||
</note></para>
|
||||
|
||||
<para>Within <literal>PropertyFileVariableSource</literal>s,
|
||||
precedence rules differ from the configuration of
|
||||
<literal>VariableSource</literal>s in the
|
||||
<literal>VariablePlaceholderConfigurer</literal>. When the same
|
||||
property occurs more than once in a property file, the value of the
|
||||
<emphasis>last</emphasis> entry will be used. Same goes for
|
||||
specifying the same variable in more than one location in a single
|
||||
<literal>PropertyFileVariableSource</literal>: the entry from the
|
||||
last file will be used.</para>
|
||||
</sect4>
|
||||
|
||||
<sect4>
|
||||
<title><literal>ConfigurableVariableSource</literal></title>
|
||||
|
||||
<para>A <literal>ConfigurableVariableSource</literal> allows you
|
||||
<para>A <literal>ConfigurableVariableSource</literal> allows you to
|
||||
define variables in-line in a variable source definition. To
|
||||
configure the variables <literal>${midge_name}</literal> and
|
||||
<literal>${midge_age}</literal>, you can use the following
|
||||
|
||||
Reference in New Issue
Block a user