This content has been marked as final.
Show 3 replies
-
1. Re: Interpolator: FacesMessages from resource bundle with pa
mars1412 Oct 30, 2007 10:00 AM (in response to mars1412)I forgot to post the explanation, why the original code does not work:
facesMessages.add("#{messages['registration.success']}", "#{webUser.name}");
When debugging into the seam source I learned, that this cannot work, because the Interpolator.interpolate() method wil:
examine the given string and try to evaluate all parameters in this string, which means:
1st: "#{messages['registration.success']}" will be evaluated
the one and only expression in this string is #{messages['registration.success']}
the evaluation of this string results in this call:Interpolator.interpolate("#{messages['registration.success']}", null)
which will return "{0} has been registered sucessfully"
because no parameters have been passed to replace the parameter {0}
then this string will be returned to the original Interpolator.interpolate() function (which has the parameters), but this resulting string will not be reevaluated, so that the given parameters will never be replaced in my message. -
2. Re: Interpolator: FacesMessages from resource bundle with pa
pmuir Oct 30, 2007 10:42 AM (in response to mars1412)I think you want something like
@In User webUser; ... facesMessages.addFromResourceBundle("registration.success", webUser.getName());
i.e. you can't add from a resource bundle with interpolation quite like you try. -
3. Re: Interpolator: FacesMessages from resource bundle with pa
mars1412 Oct 31, 2007 10:49 AM (in response to mars1412)that was exactly what I was searching for
tx pete
- U really prevented a newbie of going mad -