ITeye博客

spring configure a java.util.Properties

wangdf_jee · 2011-11-24 18:28 · Spring · 企业架构 · Markdown


<bean id="mappings"  class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
 <!-- typed as a java.util.Properties -->
 <property name="properties">
    <value>
        jdbc.driver.className=com.mysql.jdbc.Driver
        jdbc.url=jdbc:mysql://localhost:3306/mydb
    </value>
 </property>
</bean>

<bean id="mappings"  class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
 <!-- typed as a java.util.Properties -->
 <property name="location">
    <value>
   datasource.properties
    </value>
 </property>
</bean>


<bean id="mappings"  class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
 <!-- typed as a java.util.Properties -->
  <property name="locations">
               <list>
                   <value>/WEB-INF/jdbc.properties</value>
               </list>
           </property>
</bean>


评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。