views:

128

answers:

2

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

+1  A: 
BalusC
I'm using Tomcat. I used the filter-way. Worked fine. Thanks. Man you realy know how things work!
c0d3x
@c0d3x in addition to accepting the answer that worked, you are also welcome to upvote it
Bozho
I have to register myself to do that. I will do that during the next days or something.
c0d3x
+1  A: 

Put this ontop of your facelets page:

<?xml version="1.0" encoding="UTF-8" ?>

It will instruct the facelets parser.

Bozho
Ah yes, I always overlook/forgot the Facelets part. But you're right, +1.
BalusC
Thanks you for answering, but the xml tag is on top of all of my facelet pages.
c0d3x
@c0d3x check what is the response encoding (using your browser "page info")
Bozho
Maybe it's been overridden somewhere? Do you have any `<meta http-equiv="Content-Type">` header? Or maybe it's server impl/version or Facelets version specific? Can you tell a bit more about them?
BalusC