JSF how to ignore operating system language by configuring locale? -
depending on operating system $lang value, display of number different in jsf page. example, code :
<h:outputtext value="#{mycontroller.mynumbervalue}" />
with $lang = en_us.iso-8859-1, have "623, 451". $lang = fr_fr.utf-8, have "623 451".
my question how application can independent operation system configuration?
i tried following configuration in faces-config.xml doesn't work :
<locale-config> <default-locale>en</default-locale> </locale-config>
i tried encapsulate h:outputtext tag within following tag, doesn't work :
<f:view locale="en"> <h:outputtext value="#{mycontroller.mynumbervalue}" /> </f:view>
any idea resolve problem?
thanks in advance.
jsf call method integer.tostring() or long.tostring() default locale.
first solution:
call locale.setdefault(myhardcodelocale);
servletcontextlistener
second solution:
create custom formatter. can use facelets , create own outputtext numbers.
<h:outputtext value="#{mycontroller.mynumbervalue}"> <f:convertnumber type="#,###.00"/> </h:outputtext>
Comments
Post a Comment