myfaces-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Problem with inputText conversion to BigDecimal
Date Fri, 08 Apr 2011 09:12:04 GMT
Hello everybody,

I have the following problem with conversion of an inputfield to a 
BigDecimal. The input has to distinguish between zero and empty string.

The page contains the following code: 

                <h:inputText value="#{sessionBean.testvar}">
                        <f:convertNumber type="number" />

sessionBean.testvar ist a simple BigDecimal with default getter and 

Submitting the page with a empty field sets testvar to an BigDecimal with 
value 0 and rerendering of the page brings up a "0" in the inputfield 
instead of leafing it empty.

Google and our analyse of the problem pointed the following:

We use this environment: Tomcat 6.0.32, MyFaces 1.2.10 

I found Tomcat runtime parameter 
-Dorg.apache.el.parser.COERCE_TO_ZERO="false" as a workaround.

I don't want to use this workaround on our servers. (Not sure of 
side-effects on other apss)
What is the right solution to prevent this behaviour? Did I get sonething 
Is there a better solution (in MyFaces I would prefer ;-) )?

Best regards

J├╝rgen Wieners

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message