Do you mean something like a ResourceBundle.containsKey() method ?
Edit Whoops - just noticed my sarcasm may have been a little misplaced. That method is only available in java 1.6. If you're not using 1.6, I guess you could write your own method that does a get and returns false or null if a MissingResourceException exception is thrown.
[ December 13, 2007: Message edited by: Joanne Neal ] [ December 13, 2007: Message edited by: Joanne Neal ]
Joined: Sep 29, 2007
I am using 1.5, so I cannot use ResourceBundle.containsKey() I guess. Thanks for the suggestion regarding the method use.....I wanted to do something like that but is it a good practice to ask the system to throw the exception and capture it to satisfy my condition?
Joined: Aug 05, 2005
I can't think of any other way off the top of my head. You could download the 1.6 jdk and have a look at the source code to see how the containsKey method is implemented.