properties - 向 Liferay 添加额外的语言属性

标签 properties configuration liferay portlet

如何向 Liferay 添加额外的属性。

我不想覆盖现有的属性。我想在现有属性之上添加新属性

我试过这种方法,但是没有成功

<portlet>
        <portlet-name>search</portlet-name>
        <display-name>Search</display-name>
        <portlet-class>org.springframework.web.portlet.DispatcherPortlet</portlet-class>
        <init-param>
            <name>contextConfigLocation</name>
            <value>/WEB-INF/spring-config/search-portlet.xml</value>
        </init-param>
        <init-param>
            <name>config-template</name>
            <value>/WEB-INF/view/search/configuration.jsp</value>
        </init-param>        
        <expiration-cache>0</expiration-cache>
        <supports>
            <mime-type>text/html</mime-type>
            <portlet-mode>view</portlet-mode>
        </supports>
        <resource-bundle>Language</resource-bundle>
        .............
</portlet>

I have placed Language.properties file under src/main/resources/

但是,当我尝试打印 <liferay-ui:message key="test-lang-msg" /> 时我没有得到值(value)

语言.properties文件 test-lang-msg=Testing Language Properties File

最佳答案

您在 portlet.xml 中的条目不正确。

像这样提供

<resource-bundle>resource.Language</resource-bundle>

HTH 问候

关于properties - 向 Liferay 添加额外的语言属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21184474/

相关文章:

hibernate - OpenSessionInView 过滤器导致 grails run-app 爆炸?

c# - 如何重用相似但不同的类属性

wpf - 在 Visual Studio Express 中创建 WPF 库

python - 为什么 django_migrations 表在所有数据库中

.net - 如何以编程方式向 ConfigurationElementCollection 添加元素?

java - liferay钩子(Hook)部署-事件类未找到异常

java - 如何从 Liferay MVC Portlet 触发自动登录

java - 无法使用 Eclipse 上的最新更新修改属性

iphone - 为什么在非 ARC 环境中的属性上使用关键字 "strong"?

java - 将属性添加到 javax.persistence 实体