读书人

Spring中PropertyPlaceholderConfigur

发布时间: 2012-11-22 00:16:41 作者: rapoo

Spring中PropertyPlaceholderConfigurer的使用

可以通过Spring中的PropertyPlaceholderConfigurer来读取配置信息:


1.

If the class cannot be resolved at runtime to a valid class, resolution of the bean fails when it is about to be created, which is during the<!-- 方式一 --><bean class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer"><property name="locations"> <value>classpath:jdbc.properties</value> </property></bean><!--方式二 --><bean class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer"><property name="location"> <value>classpath:jdbc.properties</value> </property></bean><!-- 方式三 --><context:property-placeholder location="classpath:jdbc.properties"/>