Facelet does not convert formatted currency correctly

Posted by c0d3x on Stack Overflow See other posts from Stack Overflow or by c0d3x
Published on 2010-03-29T15:13:28Z Indexed on 2010/03/29 15:23 UTC
Read the original article Hit count: 333

Filed under:
|
|
|
|

Hi,

I have the follwing code inside a facelet page:

<h:inputNumber value="bean.property">
    <f:convertNumber type="currency" />
</h:inputNumber

The converter is because there can be a kind of default value inside the input field, which comes from the bean property. Everything is rendered correctly. The value inside the input field is rendered with an "€" character (e.g. "1.453 €".

When I submit the form there comes an error up:

"nameOfInputField" konnte nicht als ein Geldbetrag erkannt werden '304,00 â¬'

In english it is some like:

"nameOfInputField" could not be regognized as an amount of money '304,00 â¬'

Please have a look at the "€" character. It seems to be printed as "â¬". While it was rendered correctly before submitting the form, now it looks like "â¬" inside the error message and inside the input field.

All pages are encoded in UTF-8.

What is the reason for this error? How can fix it?

Thanks in advance

© Stack Overflow or respective owner

Related posts about jsf

Related posts about facelets