dcsimg
Path of Property file when using ResourceBundle
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Vig_Inpanathan
Posted On:   Thursday, March 29, 2001 12:33 PM

I am developing a Error Handling module for my current project.
What I need to know is where the ResourceBundle class looks for it.

I know that it looks for it in the classpath.But it is not always the
case.

What I am asking is, is there anyway to specify the location of
the properties file out of the application,like setting a classpath.

Re: Path of Property file when using ResourceBundle

Posted By:   Tim_Rohaly  
Posted On:   Thursday, April 19, 2001 08:03 PM

ResourceBundle uses the ClassLoader to find
the resource - the ClassLoader uses the CLASSPATH.
I don't know why you say "but it is not always the case".
If a .jar file is in the CLASSPATH, ResourceBundle will
look in the .jar file. And, like the previous poster said,
you have to be careful with qualified names.

Re: Path of Property file when using ResourceBundle

Posted By:   AlessandroA_Garbagnati  
Posted On:   Saturday, March 31, 2001 11:20 PM

Vig,

If I remember correctly, I think that you can reference the file in the same way you reference a java class:

b = ResourceBundle.getBundle("org.sim.sala.bim.MyBundle");

will look for:

/org/sim/sala/bim/MyBundle.properties
About | Sitemap | Contact