I am having trouble figuring out where to place my resource bundles inside my asp web site. My J# class file is in:
\Visual Studio Projects\WebSites\view\App_Code\com\systems\test\rbw.jsl
In rbw.jsl I do:
resourceBundle = ResourceBundle.getBundle("login", new Locale("en", "us"));
I've placed a "login.properties" file and a "login_en_US.properties" in a bunch of different file locations and I always get a "Resource Bundle not Found" exception.
Normally if you do ResourceBundle.getBundle("MyResources", new Locale("en", "US")), the resource bundle will search the classpath for a file called MyResources_en_US.properties. But under this environment I am not sure what the classpath is
Doing the following returns null:
get_Response().Write("<br>Path = " + System.getProperty("java.class.path"));
Any help would be greatly appreciated.

ResourceBundle
jsiscoe
This is being done in a asp.net environment. I can not find "Add Resource" in this mode. So it seemed like "App_GlobalResources" was a good choice to try.
I have these files:
login.properties
login_en_US.properties
login_fr.properties
And I ran:
vjsresgen /out:jsLogin.resx *.properties
I put "jsLogin.resx" in my "App_GlobalResources" directory.
I then build and run inside the ASP.NET Development Web Server.
In a j# class I do:
resourceBundle = ResourceBundle.getBundle("login");
Ideally i'd like to do:
resourceBundle = ResourceBundle.getBundle("login", new Locale("en", "US"));
Doing either causes the exception "Resource Bundle not Found". I've tried the resx in the App_Code directory and tried various bundle names based on the full name "jsLogin", "jsLogin.resx", "Login".
Thanks for any help.
nkojuharov
Hi,
J# does not use classpath variable. It searches for resources in a different manner.
You need to convert your resources to a .resx format and add it using Visual Studio IDE. This can be done using a tool -- vjsresgen.exe This sample can be downloaded from here. You will need to build this sample.
If you want to add them from commandline, then pass the output file generated by vjsresgen.exe to resgen.exe. This will generate a .resource file. This is passed to /res option of vjc.exe while compilation. If you are using IDE then you can skip the resgen.exe step.
Execute the following on commandline:
vjsresgen.exe /out:myResource.resx <specify one or more resource files that you want to add>
Add myResource.resx to your project. This can be done as follows:
In Visual Studio IDE -- Click on Project tab and then properties in the menu shown.
Click on resources tab in properties window.
Click on "Add resource" Browse to myResource.resx and select it.
Build your application and it should work.
Let me know if you have any more queries.
Sue Googe
Hi,
We have reported this problem and are currently working on it.
In the meantime, you can use the following to solve your problem.
You will need to add the resource files in the following manner:
1. Right click on the project node in solution explorer and select "Add new Item".
2. From the dialog box select "Resource File".
3. Name it as login.resx.
4. Then you would be asked to fill in the Key-Value pairs in the designer window. Once you are done, save the file.
5.Repeat all the above steps for any other resource file you want to add.
6. In your .jsl file, modify the code as follows:
Resources.login.get_<key>() will return you the value for the <key>.
7.This Code will work as equivalent to ResourceBundle.getbundle() and getString().
Incase you need to test with different locales, you can set them using System.Globalization.CultureInfo and then use the above code.
If you need any more help, let us know.