File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Applets and the fly likes Applet always use same Resource file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet always use same Resource file" Watch "Applet always use same Resource file" New topic
Author

Applet always use same Resource file

app nig
Greenhorn

Joined: Feb 26, 2008
Posts: 3
Hi All
I have a HTML page embedded with Applet. This applet takes string from property file using ResourceBundle. I send a parameter from HTML page to decide the language of applet e.g. de for germany and en for english.
My problem is , applet always use one property file. it does not changes property file according to passed parameter.If I passed paramater for english "en", then it always take property file for english wheather I passed parameter for english or German or French.
I deleted the file from control panel java plugins. i also removed files in my browser cache. But it does not work. Please let me know how can I solve my problem. Is there any other option for localization, instead of ResourceBundle class in core java
thanks
Appi
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
Hello "appi"-

Welcome to JavaRanch.

On your way in you may have missed that we have a policy on screen names here at JavaRanch. Basically, it must consist of a first name, a space, and a last name, and not be obviously fictitious. Since yours does not conform with it, please take a moment to change it, which you can do right here.

This forum is meant for question about this site, not for any Java-related question. I'll move it to the applet forum.


Ping & DNS - updated with new look and Ping home screen widget
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
How is the parameter passed to the applet? How are you using that parameter to select the resource bundle?
app nig
Greenhorn

Joined: Feb 26, 2008
Posts: 3
I am passing parameter using <PARAM> tag, which I get inside applet with that param name. Based on that parameter I create ResourceBundle object. e.g.

String myLanguage= getParameter("parameter_name");
String BUNDLE_NAME = "myPropertFile";
ResourceBundle RESOURCE_BUNDLE=ResourceBundle.getBundle(BUNDLE_NAME,new Locale(myLanguage));
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Applet always use same Resource file
 
Similar Threads
JSP Pages and i18n
Passed Part One with 87%
Passed!
Passed
passing a parameter back to my HTML page from my applet