카테고리 없음

PropertyPlaceholderConfigurer 사용법

가는가래 2013. 6. 30. 18:01

PropertyPlaceholderConfigurer 사용법

1. properties가 1개일 경우

    <beans:bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">    
      <beans:property name="locations" value="classpath:jdbc.properties"/>    
      <beans:property name="fileEncoding" value="UTF-8"/>
    </beans:bean>

2. properties가 여러개일 경우
    
     <beans:bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
       <beans:property name="locations">
        <beans:list>
          <beans:value>classpath:jdbc.properties</beans:value>
        </beans:list>   
      </beans:property>
      <beans:property name="fileEncoding" value="UTF-8"/>
    </beans:bean>