propertyplaceholderconfigurer,在xml config中具有配置文件

wnrlj8wa  于 2021-07-13  发布在  Java
关注(0)|答案(0)|浏览(246)

我正在尝试将PropertyPlaceHolderConfiger整合到spring项目的xml配置中。我在运行项目之前设置了活动概要文件,并希望相应地设置属性文件层次结构。下面的设置无法工作,因为它无法解析 $spring.profiles.active 你能给我一个建议吗。

<bean id="propertyPlaceholderConfigurer" class="org.jasypt.spring31.properties.EncryptablePropertyPlaceholderConfigurer">
        <constructor-arg ref="configurationEncryptor" />
        <property name="locations">
            <list>
                <!-- Environment specific properties -->
                <value>file:application-$spring.profiles.active.properties</value>
                <!-- Application specific properties -->
                <value>file:application.properties</value>
            </list>
        </property>
        <property name="systemPropertiesModeName" value="SYSTEM_PROPERTIES_MODE_OVERRIDE"/>
    </bean>

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题