• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to use getStringArray of ResourceBundle

 
Ranch Hand
Posts: 169
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am trying to get the array of string from a property file using the
getStringArray of ResourceBundle class. But it is giving class cast Exception.
My property file looks like:

NVFORMS="GSLTW1NV","GSLTW1NV","GSLTW1NV","GSLTW1NV","GSLTW1NV","GSLTW1NV"
I also tried following formats. None of them worked.

NVFORMS= GSLTW1NV1 GSLTW1NV2 GSLTW1NV3
NVFORMS={"GSLTW1NV1", "GSLTW1NV2", "GSLTW1NV3"}

So if you have worked on this before successfully, please let me know.
(No speculations please )
Thanks in advance.
 
Ranch Hand
Posts: 118
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've been looking around... I can't find much information on it. You can use this for now though:

[ July 09, 2004: Message edited by: Darin Niard ]
 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Darin Niard wrote:I've been looking around... I can't find much information on it. You can use this for now though:

[ July 09, 2004: Message edited by: Darin Niard ]



thanks but did you try it , i mean where is your reference
 
Ranch Hand
Posts: 48
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

shareeef hiasat wrote:

Darin Niard wrote:I've been looking around... I can't find much information on it. You can use this for now though:

[ July 09, 2004: Message edited by: Darin Niard ]



thanks but did you try it , i mean where is your reference



This should work.
This is a general code.
rb.getString("NVFORMS").split(":"); is valid code.
But need to do the null check.

String[] s=null;
if(rb.getString("NVFORMS") !=null){
s = rb.getString("NVFORMS").split(":");
}


 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic