It's not a secret anymore!
The moose likes Beginning Java and the fly likes getting Properties file in MessageBundle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "getting Properties file in MessageBundle" Watch "getting Properties file in MessageBundle" New topic

getting Properties file in MessageBundle

Chiranjeevi Kanthraj
Ranch Hand

Joined: Feb 18, 2008
Posts: 290

hi all
This is my code

and i am getting the Error

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.

Lance Miller

Joined: Jun 23, 2008
Posts: 21
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 "". If it can't find that file, it will look for a file name "". Finally, if it can't find that file, it will search for the default file of ""

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 ]
I agree. Here's the link:
subject: getting Properties file in MessageBundle
jQuery in Action, 3rd edition