0

This question is related to JSF, but i think even resourcebundle answers might help.

I am trying to load a properties file in a faces-config.xml file

<resource-bundle>
    <base-name>myconfig</base-name>
    <var>myConfig/var>
</resource-bundle>

This would work i assume. However, what I really want to do is:

<resource-bundle>
    <base-name>my.config</base-name> (Note the name has a ".")
    <var>myconfig</var>
</resource-bundle>

I want this code to load a my.config.properties file from where it would have normally picked up myconfig.properties file.

Instead this seems to be looking for config.properties in a "/my" location on the classpath.

Basil Dsouza
  • 160
  • 1
  • 10
  • 2
    Not sure why you can't just rename the file, but I believe [this answer](http://stackoverflow.com/a/3646601/247221) could give you an idea how to override the default loading mechanism with your own. It is possible to instantiate [PropertyResourceBundle](http://docs.oracle.com/javase/7/docs/api/java/util/PropertyResourceBundle.html) and give it an `InputStream` of a `Reader`, so you can load the properties file manually (no other way, I am afraid). You will lose the fallback (unless you want to code it yourself), but if you want to do it the hard way, I am not the one to stop you. – Paweł Dyda Jun 16 '14 at 21:07
  • Fair enough, I went and changed the file name. Did not want to do that cause it messed with our naming conventions of files. But not that big a deal to change the file name. – Basil Dsouza Jun 17 '14 at 09:22

0 Answers0