cancel
Showing results for 
Search instead for 
Did you mean: 

WD - ResourceBundle (xxx.properties)

Former Member
0 Kudos

Hi,

I've currently a WD application in which I retrieve data from a <i>properties-file</i> (for language issues) depending on the <b>Locale</b>.

For the moment I read the file with <b>FileReader & BufferedReader</b> (works fine), but I want to use <b>ResourceBundle</b> because I can easily read the file with a key.

But the problem is, that I cannot read the <i>properties-file</i> or better said, I don't know where to place the file.

The error message I get is:

<i>Can't find bundle for base name rb_file, locale en_US</i>

Anyone encountered this issue?

Greetz,

Bart

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Bart,

U can place the property file in the gen_wdp>packages><Your Package Name>.

Right click the package name and paste the file in this structure.

For accessing this resoutrce bundle inside ur component.

<b>ResourceBundle bundle = ResourceBundle.getBundle("<path of the resource bundle.(Package name.Res bundle name)>");

String name = bundle.getString("<value inside the res bundle>");</b>

Hope it helps,

Regards,

Nagarajan.

Former Member
0 Kudos

Hello,

Check out this link "http://help.sap.com/saphelp_nw2004s/helpdata/en/9e/093aeec9b8634789fa07b3301f1a44/content.htm"

for a thorough explanation.

Bala

Answers (1)

Answers (1)

Former Member
0 Kudos

Wauw, thx for the very quick response!

I've solved the problem and you both give me a part of the solution.

I had to import the file like <i>Bala Krishnan</i> said.

Then I had to addapt the code like <i>Nagarajan Kumarappan</i> explained.

Thx again!

Former Member
0 Kudos

Ich würde das Resource Bundle besser in src/packages packen und nicht in das generierte gen_wdp Verzeichnis... Das wird dann automatisch dorthin kopiert.

Frank