1 Reply Latest reply: Nov 15, 2012 8:31 AM by codigoadf RSS

    Reloading external resource-bundle


      Version : Jdev &

      I was wondering , if there is any possible way to reload faces-config.xml.

      My Scenario's :

      I have configured a bundle in faces-config.xml
      and my bundle class loads data from an external propertyFile
      public class loadMyBundle extends ListResourceBundle {
        protected Object[][] getContents() {
            PropertyResourceBundle resource= null;
              try {
                  File file = new File("C:\myBundle.properties");
                  fileInputStream = new FileInputStream(file);
                  resource = new PropertyResourceBundle(fileInputStream);
              if (resource != null) {           
                       filling data from loaded property file into contents 
              } catch (IOException ioException) {
              } catch (Exception exception) {
              return contents;
      This getContents method is just called once even if I have changed a label value, where as my scenario to call "getContents" method is called when the resource file is changed or once per session atleast.

      I tried using loadBundle
      <f:loadBundle basename="test.backing.loadMyBundle"
      but this refers & loads the property file again & again.

      My requirment :

      Scenario 1. Is there any way, to reload faces-config.xml every time the session is created. So that new property file is loaded.
      or Scenario 2. Is there any way, I can cache the already loaded bundle & reuse it instead of making a IO call to load file.

      Thanx in advance.
        • 1. Re: Reloading external resource-bundle
          maybe these links will help you