title: Spring :Why can't configure two ServletContextPropertyPlaceholderConfigurer in separated .xml?
body: <p>Greetings,</p>
  <p>I am working on a spring based web application. Situation is :</p>
  <ol>
  <li><p>there are two .xml file one application-context.xml , other is default-context.xml</p>
  </li>
  <li><p>application-context.xml will be load to web context when tomcat started ,which is configured in web.xml</p>
  </li>
  <li><p>application-context.xml ServletContextPropertyPlaceholderConfigurer loaded some properties.and import <strong>default-context.xml</strong></p>
  <p>because default-context.xml is in another project, and I want it have its own .properties(default-context.properties) file and set up a ServletContextPropertyPlaceholderConfigurer for it to load the properties.</p>
  </li>
  </ol>
  <p>the current result is that : the properties in default-context.properties is not loaded, and the ServletContextPropertyPlaceholderConfigurer in <strong>default-context.xml</strong> is not inited. It reports</p>
  <blockquote>
  <p>can't resolve placeholder for xxxxxx&quot;</p>
  </blockquote>
  <p>I tried some combinations,</p>
  <p>1.to load default-context.properties in application-context.xml 's ServletContextPropertyPlaceholderConfigurer ,its worked.</p>
  <p>2.to load default-context.properties in application-context.xml 's <strong>PropertyPlaceholderConfigurer</strong> ,NOT work. I guess its because the PropertyPlaceholderConfigurer can't be load to servlet context?</p>
  <p>3.loading default-context.properties in default-context.xml in both ways (ServletContextPropertyPlaceholderConfigurer or PropertyPlaceholderConfigurer)
  NOT work.</p>
  <p>I can't figure out why <strong>there's only one ServletContextPropertyPlaceholderConfigurer can be configured in servlet context</strong>?</p>
  <p>configuration is like :
  in application-context.xml</p>
  <pre><code>      &lt;class=&quot;org.springframework.web.context.support.ServletContextPropertyPlaceholderConfigurer&quot;&gt;
      &lt;property name=&quot;locations&quot;&gt;
          &lt;list&gt;
              &lt;value&gt;classpath:etc/system.properties
              &lt;/value&gt;
  </code></pre>
  <p>...
  
  
  
  </p>
  <p>in default-context.xml :</p>
  <pre><code> &lt;bean id=&quot;tempName123&quot;
      class=&quot;org.springframework.web.context.support.ServletContextPropertyPlaceholderConfigurer&quot; &gt;
      &lt;property name=&quot;locations&quot;&gt;
          &lt;list&gt;
             &lt;value&gt;classpath:etc/default-datasource.properties&lt;/value&gt;
          &lt;/list&gt;
      &lt;/property&gt;
  &lt;/bean&gt;
  </code></pre>