Resource bundles contain locale-specific objects. When your program needs a locale-specific resource, a String for example, your program can load it from the resource bundle that is appropriate for the current user's locale. In this way, you can write program code that is largely independent of the user's locale isolating most, if not all, of the locale-specific information in resource bundles. This allows you to write programs that can: be easily localized, or translated, into different languages
handle multiple locales at once
be easily modified later to support even more locales
handle multiple locales at once
be easily modified later to support even more locales
解决方案 »
- 我想为我们学校做一个教师个人主页管理系统网站,能够真正的给老师用的,想与大虾交流交流。
- 谁能帮我看看这个错误提示是什么意思?头一次遇到!
- struts 中如何用变量控制标签的只读属性?再线等
- 二维码扫描枪在B/S模式下的应用
- 如何在JSP页面实现调查表功能
- jni调用返回数组一个没问题,两个以上就报错,EXCEPTION_ACCESS_VIOLATION (0xc0000005)这时候为什么?一般这时候什么造成的?
- Jsp页面排版问题
- 为什么用存储过程代替动态sql语句可以防止SQL注入攻击?
- 大家请告诉我TOMCAT+IIS+MYSQL+JSP的配置方法,在线等侯,一定给分,谢谢!!
- 怎么让网页显示的时候是全屏幕的,就是IE的菜单都看不见???
- win98+j2se下"import javax.servlet"错误 是不是要求j2ee 而j2ee是不是一定要win2000
- 时间紧迫!各位帮忙小弟啊!
aaa_en.properties aaa_zh_CN.properties 放在classpath下的目录ccc中,则在应用程序中如果如下使用:
ResourceBundle resources;
res = ResourceBundle.getBundle("ccc.aaa",Locale.getDefault());在aaa_en.properties中有 NOTFOUND=not found在aaa_zh_CN.properties中有 NOTFOUND=未发现则res.getString("NOTFOUND") 的结果如下:
如果你的系统缺省区域设置为中文,则返回字符串“未发现”
如果你的系统缺省区域设置为英文,则返回字符串“not found”关键在于properties文件的命名,中文为*_zn_CN.properties, 英文为*_en.properties,其他国家的命名方法请查找资料