1.如果是引入的是xml配置文件:
使用 <import resource="classpath:*.xml"
/>引入。
2.引入properties文件
方式一:单个配置文件()配置ignore-unresolvable="true" 解决延迟加载异常):
<context:property-placeholder location="classpath*:properties/jdbc.properties" ignore-unresolvable="true"/>
方式二:单个或者多个
<bean id="propertyConfigure" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath:1.properties</value>
<value>classpath:2.properties</value>
</list>
</property>
</bean>
本文介绍了在Spring框架中如何加载不同类型的配置文件,包括XML配置文件及Properties文件,并提供了具体的配置示例。

被折叠的 条评论
为什么被折叠?



