无法找到基本名称消息的捆绑包

时间:2014-12-25 18:52:31

标签: java localization resources classpath resourcebundle

我的捆绑包有以下结构

enter image description here

但代码

ResourceBundle bundle = ResourceBundle.getBundle("resources/locales/messages", new Locale("ru"));

抛出异常

java.util.MissingResourceException: Can't find bundle for base name resources/locales/messages, locale ru
    at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1499)
    at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1322)
    at java.util.ResourceBundle.getBundle(ResourceBundle.java:795)

如何从资源加载捆绑包?

0 个答案:

没有答案