Monday, 30 January 2012

JSF: outputText doesn't not localize a Double-value

I want to localize the Double attribute value of the managed bean fooBean in Greek; i.e. number 12.3 should be 12,3 in greek locale (locale=el) and 12.3 in english locale (locale=en) Wrong code:
 <h:outputText value="#{fooBean.value}" />
Right code:
 <h:outputText value="#{fooBean.value">
    <f:convertNumber type="number" />


  1. Can you repost the right and wrong code please?

    btw I found your blog while searching for a solution for greek data entered in input text fields, when I display them in a e.g. datatable they come out like χαιρετω while the labels etc don't have any problem with the greek.
    Any ideas?

  2. Hi MarJSF. As far as I can figure out the encoding in your pages is ok since the labels work fine. The problem is probably in the db; either on storing the data or retrieving this post for the right way to save utf-8 data in the db (mysql).