2 Replies Latest reply on Mar 28, 2013 4:32 AM by magick93

    Adding custom key values to errai properties files

    magick93

      HI

       

      Is it possible, and if so, how, do I add custom values - and retrieve them - from an errai properties file?

       

      Thanks

      Anton

        • 1. Re: Adding custom key values to errai properties files
          jfuerth

          Hi Anton,

           

          Yes, this is possible!

           

          To add custom keys, just put them in there. Errai's configurable parts ignore properties they don't understand. I would recommend you avoid making up properties names that start with "errai." and instead choose a prefix (such as "org.mycompany.") to avoid accidentally colliding with future Errai features, or future 3rd party Errai extensions.

           

          To retrieve the values within your app, you can call org.jboss.errai.config.rebind.EnvUtil.getErraiAppProperties() at rebind time, iterate over the returned collection of Properties instances (one for each ErraiApp.properties on the classpath), and pull out the configuration data you need.

           

          -Jonathan

          • 2. Re: Adding custom key values to errai properties files
            magick93

            Thanks Jonathan