首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

ResourceBundle加载资料的顺序

2012-09-19 
ResourceBundle加载文件的顺序If a ResourceBundle class for the specified Locale does not exist, getB

ResourceBundle加载文件的顺序

If a ResourceBundle class for the specified Locale does not exist, getBundle tries to find the closest match. For example, if ButtonLabel_fr_CA_UNIX is the desired class and the default Locale is en_US, getBundle will look for classes in the following order:

ButtonLabel_fr_CA_UNIXButtonLabel_fr_CAButtonLabel_frButtonLabel_en_USButtonLabel_enButtonLabel

Note that getBundle looks for classes based on the default Locale before it selects the base class (ButtonLabel). If getBundle fails to find a match in the preceding list of classes, it throws a MissingResourceException. To avoid throwing this exception, you should always provide a base class with no suffixes.

?

http://docs.oracle.com/javase/tutorial/i18n/resbundle/concept.html

?

热点排行