<bean id="xxxProp" class="org.springframework.beans.factory.config.PropertiesFactoryBean"> <property name="locations"><!-- 这里是PropertiesFactoryBean类,它也有个locations属性,也是接收一个数组,跟上面一样 <array> <value>classpath:public.properties</value> </array> </property> </bean>
代码里直接: @Autowired private Properties xxxProp;
|