wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes PropertyResourceBundle.getStringArray() doesn't quite work as expected... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "PropertyResourceBundle.getStringArray() doesn Watch "PropertyResourceBundle.getStringArray() doesn New topic
Author

PropertyResourceBundle.getStringArray() doesn't quite work as expected...

SAFROLE YUTANI
Ranch Hand

Joined: Jul 06, 2001
Posts: 257
I have a property file that I read into a PropertyResourceBundle object like this....
PropertyResourceBundle resource = (PropertyResourceBundle)ResourceBundle.getBundle( "db");
I have an entry in the "db" property file that contains values which are comma delimited, like this...
arr=1,2,3
but when I call resource.getStringArray("arr"), I get a ClassCastException.
I want to get back a String array, which is the return type of getStringArray() anyway! I dont see what the problem is.
Any help would be appreciated!
SAF
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9053
    
  12
Is arr an array of Strings?

JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
SAFROLE YUTANI
Ranch Hand

Joined: Jul 06, 2001
Posts: 257
No. "arr" is an entry in the properties file. It doesn't matter at this point anyway because I managed to find a work around for it.
thanks
SAF
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: PropertyResourceBundle.getStringArray() doesn't quite work as expected...