有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java在用pom加载属性文件方面的差异。xml和在applicationContext中创建占位符。xml

我有一个基于环境加载的属性文件。我在applicationContext中创建了一个占位符。xml

<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
    <property name="locations">
        <list>
            <value>classpath:environment-${buildProfile}.properties</value>
        </list>
    </property>
</bean>

还有一种方法可以通过Maven加载此文件

你能告诉我哪种方式加载属性文件更好吗?这方面有什么性能差异吗


共 (0) 个答案