我有一个简单的bean在会话范围内提供“翻译方法”JSF/CDI:用绿豆请求字符串从资源
String getText(String key, Object args ...) {
...// lookup in property resource
return value;
}
我想叫这个bean让我的UI组件本地化的文本字符串。当试图呼叫上述功能时,例如通过
<p:outputLabel for="name" value="#{lang.getText(xyz,arg1)}" />
<p:inputText id="name" value="#{formProject.entity.name}"/>
<p:message for="name" id="msgName" />
我得到java.lang.IllegalArgumentException异常:错误的参数数目
现在,我的问题
1) Is this generally a good alternative to <f:loadBundle> to localize my components?
2) Since I am able to address my nested bean fields via bean1.bean2.myfield
how to avoid conflicts when adressing the properties dot-sepatated,
i.e. x.y.z instead of xyz?
我不认为我是在右边跟踪当前...
感谢您的回答,很好的解决方法...... –