0 Replies Latest reply on Nov 4, 2008 8:55 AM by nimo stephan

    Interpolator vs MessageFormat

    nimo stephan Master

      I have red this:


      I have used the interpolater:

      String a = Interpolator.instance().interpolate("#{messages['myGreetings']}", "john");

      My properties-file has the key 'myGreetings':

      myGreetings = hello {0}

      But this does not work, my message get not resolved,
      The output is:

      hello {0} instead of hello john.

      When I use this, it works:

      String t= SeamResourceBundle.getBundle().getString("myGreetings");
      String resolved = MessageFormat.format(t, "john");

      The output is:

      hello john. The variable {0} is resolved successfully.

      So, what is wrong with my Interpolator ???