I have integer properties from my bean binded to inputtext UI elements in jsp pages.
initially when they are rendered, default value of this integer properties is null.
Now when i am submitting the form without changing this inputtext fields, this fields are set to integer value zero in bean, even though ui text field is blank.
As i want to track the changes to fields and update only those fields which are changed in configuration files, but this is giving me problem as it results into updates to all integer field.
I am using jsf 1.2
This issue is however specific to EL implementation of Tomcat (Glassfish for example, doesn't expose this stupid behaviour). It used to work "as intuitively expected" until Tomcat 6.0.16. Then they discovered that it actually violated the literal EL spec and fixed it. After a lot of critism, they made it configureable from 6.0.17 and upwards. You can turn it off by adding the following VM argument:
-Dorg.apache.el.parser.COERCE_TO_ZERO=false
This is IMO better than hacking into getters/setters. You don't want to pollute your model like that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With