简体   繁体   English

getbundle(basename)ResourceBundle java

[英]getbundle(basename) ResourceBundle java

What is basename in ResourceBundle I have example and files like this 我有示例和类似文件的ResourceBundle中的基本名称是什么

import java.util.Locale;
import java.util.ResourceBundle;

public class Main 
{
      public static void main(String[] argv) throws Exception 
      {
          ResourceBundle rb = ResourceBundle.getBundle("RresourcesDynamic");
          System.out.println(rb.getString("title"));
      }
}
  ///here when i run this program i am getting exception like this
  //Exception in thread "main" java.util.MissingResourceException: Can't                bundle     for base name RresourcesDynamic, locale en_US



  //what is basename what i have to mention in this argument is this file name or what?

ResourcesDynamic.properties----title=leo ResourcesDynamic.properties ---- title =利奥

Thanks in advance 提前致谢

RresourcesDynamic (in source) != ResourcesDynamic (filename) RresourcesDynamic(在源代码中)!= ResourcesDynamic(文件名)

Full explanation 完整说明

Short: ResourceBundle.properties (usual key=value properties file) must exists in class path 简短说明:ResourceBundle.properties(通常为key = value属性文件)必须存在于类路径中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM