java.lang.IllegalArgumentException: Could not resolve placeholder

201 阅读1分钟

当在配置文件中写了两处:

<bean id="propertyConfigurer"
          class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="location" value="classpath:jdbc.properties" />
    </bean>

就会找不到第一个配置文件中的属性…
引入多个,应该这么写:

  <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <list>
                <value>classpath:test.properties</value>
                <value>classpath:jdbc.properties</value>
            </list>
        </property>
    </bean>

创作打卡挑战赛

赢取流量/现金/CSDN周边激励大奖