* A property resource configurer that resolves placeholders in bean property values of
* context definitions. It <i>pulls</i> values from a properties file into bean definitions.
${hibernate.connection.driver_class}
通过以下方式可以在spring配置文件中引用properties文件中定义的变量
hibernate.connection.driver_class=××××××
* context definitions. It <i>pulls</i> values from a properties file into bean definitions.
xml 代码
- <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
- <property name="locations">
- <list>
- <value>classpath:hibernate.properties</value>
- <value>classpath:framework.properties</value>
- </list>
- </property>
- </bean>
${hibernate.connection.driver_class}
通过以下方式可以在spring配置文件中引用properties文件中定义的变量
hibernate.connection.driver_class=××××××