This works :
<h:outputText value="Active Locale : " />
#{view.locale}
But how can i achieve something like this with EL ?
<h:outputText value="Active Locale Decimal Separator : " />
#{new DecimalFormat(view.locale).decimalFormatSymbols.groupingSeparator}
I wonder what you exactly mean with
groupingSeparator?The standard
java.text.DecimalFormathas neither agetGroupingSeparatornorgroupingSeparatorfield or method. So I’m a bit in the dark what you’re actually trying to achieve. Would you like to have the _ printed? So if the local is en_uk, that the result is “_”?Regardless of what you exactly want, you can pretty much do everything by building your own EL functon. In EL it would then look like this:
someFormatting is then implemented as a static Java method, which you then assign your own namespace (“my” in this case). Look up a tutorial to help you with this if you need that.
There are also a few standard EL functions available to Facelets. These are the JSTL functions defined in the following namespace:
Depending on what you exactly need they may be of some help as well.