title: Property Placeholder for Imports/Bean Refs
body: <p>Can I use a property loaded from property-placeholder to make a context import dynamic?</p>
  
  <pre><code>&lt;context:property-placeholder location="classpath*:/enterprise.properties"/&gt;
  &lt;import resource="classpath*:/Fsb${jdbc.ctxType?:Jdbc}-context.xml"/&gt;
  </code></pre>
  
  <p>Properties File</p>
  
  <pre><code>jdbc.ctxType=JTA
  </code></pre>
  
  <p>So this way I could change the type of context file that is loaded based on a property.</p>
  
  <p>Also, can I do the same thing to make a bean ref name dynamic?</p>
  
  <pre><code>&lt;bean id="personBusinessService" class="com.foo.PersonBusinessServiceImpl"
            p:personUidDataService-ref="personUidDataService${personUidDataService.sib?:Api}" 
            p:identifierLookupSearchService-ref="identifierLookupSearchService${identifierLookupSearchService.sib?:Api}"  
            p:contactPointBusinessService-ref="contactPointBusinessService${contactPointBusinessService.sib?:Api}"
  /&gt;
  </code></pre>
  
  <p>Properties File</p>
  
  <pre><code>personUidDataService.sib=Stub
  </code></pre>
  
  <p>Jay </p>
  
  <p>--------------------Update example of property for ref-------------------------</p>
  
  <p>I created a property file with the following entry:</p>
  
  <pre><code>addressLookupSearchService.sib=DaoMock
  </code></pre>
  
  <p>Then I have the following configuration in a Spring Context File:</p>
  
  <pre><code>&lt;context:property-placeholder location="classpath*:/simple.properties"/&gt;
  
  &lt;!-- EntityManager will be injected into DAO by JPA annotations --&gt;
  &lt;bean id="addressSearchDao" class="com.foo.AddressSearchDaoImpl"/&gt;
  
  &lt;bean id="addressSearchDaoMock" class="com.foo.MockAddressSearchDaoImpl"/&gt;
  
  &lt;bean id="addressLookupSearchService" class="com.foo.AddressLookupSearchServiceImpl"
      p:baseDao-ref="addressSearch${addressLookupSearchService.sib?:Dao}"/&gt;
  </code></pre>
  
  <p>And addressSearch${addressLookupSearchService.sib?:Dao} doesn't work, it always defaults to
  the bean id of addressSearchDao even if my property says it should set to addressSearchDaoMock.</p>
  
  <p>Any thoughts as to what I am doing wrong?</p>