This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes Question about ResourceBundle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Question about ResourceBundle" Watch "Question about ResourceBundle" New topic

Question about ResourceBundle

arnold yan
Ranch Hand

Joined: May 31, 2002
Posts: 40
If I back a ResourceBundle with Properties Files on the disk, and name it
When I try to get the bundle by using
ResourceBundle bundle =
How does the JVM know which directory on the disk it should look for the properties file? Does it search for the entire disk?
boyet silverio
Ranch Hand

Joined: Aug 28, 2002
Posts: 173
in a web app, the searching is similar to that of looking for a class under the WEB-INF/classes dir. In this case '' is understood to be directly in the 'classes' folder. If the file is in another dir say '/WEB-INF/classes/com/here/' then the parameter passed to the getBundle method should be fully qualified to guide the searching e.g.
ResourceBundle bundle =
Used ResourceBundles in jsp web app dev but haven't tried it in other cases. Probably in other cases (such e.g. java app), the .properties file, if unqualified, will be searched in the location of the class using it. If in another location, might need to have it jarred and register it in classpath in order to be accessed.
subject: Question about ResourceBundle
Similar Threads
refresh ResourceBundle contents
not able to locate using ResourceBundle
best way to re-use strings (labels and error messages)
ResourceBundles & Properties
refresh ResourceBundle contents