Thanks for suggestions. I need to specify a dynamic location of the resource
file and then load it.
I have found an answer using URLClassLoader:
String fileName =
"file://///export//opt//dev//ecare//langres//";
URL url = new URL(fileName);
URL[] urls = {url};
URLClassLoader classloader = new URLClassLoader(urls);
Locale locale = new Locale("zh" , "TW");
ResourceBundle res = ResourceBundle.getBundle("resource" ,
locale, classloader);
thanks
Jeff
-----Original Message-----
From: Tomm Carr [mailto:[EMAIL PROTECTED]]
Sent: Monday, September 16, 2002 6:39 PM
To: JDJList
Subject: [jdjlist] Re: resource file
Yan, Hong [IT] wrote:
> I need to use ResourceBundle to load a resource file, but the location
> of the file is dynamic. Can I specify an absolute path for my resouce
> file?
If it is a servlet, you could specify the location as an init parameter
in the web.xml file. Otherwise, I suppose, you could have it in a .cfg
or .ini file. I am curious why the resource file is so movable.
Tomm
To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm
To change your JDJList options, please visit: http://www.sys-con.com/java/list.cfm