gpt4 book ai didi

java - getbundle(basename) ResourceBundle java 资源包

转载 作者:行者123 更新时间:2023-12-01 15:39:33 24 4
gpt4 key购买 nike

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

提前致谢

最佳答案

RresourcesDynamic(源代码中)!= ResourcesDynamic(文件名)

Full explanation

简短:ResourceBundle.properties(通常的 key=value 属性文件)必须存在于类路径

关于java - getbundle(basename) ResourceBundle java 资源包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8292531/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com