Please tell me how can i give the Base name parameter to the getBundle() method. And my MessageBundle with all Locale is present in the same directory. Thanks
posted 7 years ago
The getBundle() method will look for the desired resource bundle on the classpath. In this case, since the locale you are passing in is "en_US", and you are using "MessageBundle" for the baseName, it searches the classpath for the file "MessageBundle_en_US.properties". If it can't find that file, it will look for a file name "MessageBundle_en.properties". Finally, if it can't find that file, it will search for the default file of "MessageBundle.properties"
Check to make sure your resource bundles are on your classpath or that you are specifying their location as part of the classpath. That is most likely the issue. Also take a look at the Java Tutorial on Resource Bundles Usage. [ July 21, 2008: Message edited by: Lance Miller ]