【问题标题】:Load properties file based on language Properties Placeholder根据语言属性占位符加载属性文件
【发布时间】:2013-11-21 05:04:45
【问题描述】:
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
 <property name="locations">
    <value>classpath*:app.properties</value>

加载单个属性文件工作正常,但现在我需要根据请求(有效负载)输入提供的语言加载 app_en.propertiesapp_fr.properties 文件。这个怎么配置?

【问题讨论】:

    标签: java spring properties


    【解决方案1】:

    为此使用列表标签

    <property name="locations">
        <list>
            <value>classpath*:app.properties</value>
            <value>classpath*:app_en.properties</value>
        </list>
    </property>
    

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-08-03
    • 2011-09-17
    • 1970-01-01
    • 2012-12-19
    • 2021-04-03
    • 2017-03-21
    • 1970-01-01
    • 2015-08-09
    相关资源
    最近更新 更多