Tomcat JSF 1 Error with f:convertNumber

Asked

Viewed 70 times

1

Hello, I use my application on Tomcat 6, I need to switch to Tomcat 7 but everywhere I use f:convertNumber I get the following error:

/pages/Pvt/ipd/client/consultar.xhtml @37,105 value="#{clientPocketController.cliente.codcustomer}": Can’t set Property 'codcliente' on class 'br.com.Mili.entities.geral.cliente.Client' to value '1.793'

Edited

<h:inputText id="txtCodCliente" value="#{clientePocketController.cliente.codcliente}" 
         converterMessage="Permitido apenas números.">
     <f:convertNumber integerOnly="true" minIntegerDigits="0"  pattern="######" locale="pt_BR"/>
     <f:validateLength maximum="6" />
</h:inputText>

I am using JSF 1.2. Can anyone help me? Thanks.

  • Thanks for the feedback Bruno, but I already have the locale configured in the faces-config ( <default-locale>pt_BR</default-locale>) and I also tested with the locale in convertNumber, but it doesn’t change anything. There’s some information missing that could help?

  • You would have to know in more detail how your project is, such as the EL version in its classpath. If you are using the Tomcat version, you may be making a mistake. Try to list everything that has to do with Binding information, library version, data type in your bean, etc.

  • I updated the lib on Tomcat (I did the same for Tomcat 6 and 7), I am using el-api-2.2.0.jar and el-impl-2.2. jar, JSF 1.2. The error on any type of property (Integer, Bidecimal, Double). Would it not be better if I create my own convert?!

  • I did, I had changed Tomcat’s lib el-api to that el-api-2.2.0, and that was the problem. My mistake. Thanks for the help.

1 answer

-1

Maybe the problem is that you are setting the value = '1.793' in an integer type field, but jsf already has a default converter for the Integer type that in this case would not need to specify.

  • It is not Paul, I put 1793, only in the error message that returns 1.793. If I shoot the convert works...

Browser other questions tagged

You are not signed in. Login or sign up in order to post.