java.util.MissingResourceException:找不到基本名称消息的bundle,locale en_US [英] java.util.MissingResourceException: Can't find bundle for base name messages, locale en_US

查看:185
本文介绍了java.util.MissingResourceException:找不到基本名称消息的bundle,locale en_US的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是JSF的新手,正在尝试这段代码..这是我的faces-config.xml:

I am new to JSF an was trying out this piece of code.. This is my faces-config.xml:

<application>
        <resource-bundle>
            <base-name>messages</base-name>
            <var>msg</var>
        </resource-bundle>
    </application>

消息是一个存储一些属性的文件,消息文件没有放在任何目录下,它是直接放在申请表下。为什么我无法访问此文件?
提前谢谢..如果您需要任何其他信息,请告诉我。

messages is a file that stores a few properties and messages file is not placed under any directory, it is placed directly under the application. Why cant i access this file? Thank you in advance.. please do let me know if you need any additional information..

推荐答案

看起来像您的文件放在 src 文件夹中的某个包中

looks like your file placed in some package inside your src folder

<base-name>some.package.name.Messages</base-name>

还要确保文件名为 Messages.properties

btw您是否知道 Messages.properties 文件将允许您覆盖验证器错误消息?

b.t.w are you aware that Messages.properties file will allow you to override your validators error messages?

另外,看看这个漂亮的教程 JSF 2消息和消息示例

Also, take a look at this nice tutorial JSF 2 message and messages example

这篇关于java.util.MissingResourceException:找不到基本名称消息的bundle,locale en_US的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆