[英]“Can't find bundle for base name messages” error
while running my application I get the following error: 在运行我的应用程序时,我收到以下错误:
javax.el.ELException: /view/doi/common/navigation.xhtml: Can't find bundle for base name messages, locale de_CH
at com.sun.faces.facelets.compiler.TextInstruction.write(TextInstruction.java:90)
at com.sun.faces.facelets.compiler.UIInstructions.encodeBegin(UIInstructions.java:82)
at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:302)
at com.sun.faces.renderkit.html_basic.GroupRenderer.encodeChildren(GroupRenderer.java:105)
at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:845)
In my faces-config I specified this: 在我的faces-config中我指定了这个:
<resource-bundle>
<base-name>messages</base-name>
<var>msg</var>
</resource-bundle>
and I have a directory src\\web\\resources\\msg with the file messages_en.propeties. 我有一个目录src \\ web \\ resources \\ msg,文件messages_en.propeties。
What am I missing? 我错过了什么?
Based on the exception, the locale that the server is looking for is de_CH
or failing that, de
. 基于异常,服务器正在寻找的语言环境是
de_CH
或者失败, de
。 If that fails too, then it will look for 'default' language, but what that is, depends on your system settings. 如果那也失败了,那么它会寻找“默认”语言,但这取决于你的系统设置。 So it may never even go to
messages_en.properties
. 所以它甚至可能永远不会
messages_en.properties
到messages_en.properties
。 You could provide messages.properties
instead (without any locale indicator) to serve as a default, if that's what you want. 您可以提供
messages.properties
(不带任何区域设置指示符)作为默认值,如果这是您想要的。
Also read here for the full explanation of how the locale resolution works: http://java.sun.com/developer/technicalArticles/Intl/ResourceBundles/ 另请阅读此处以获取有关区域设置解析如何工作的完整说明: http : //java.sun.com/developer/technicalArticles/Intl/ResourceBundles/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.