Second, if you're using Tomcat/JBoss or any server which uses Apache EL parser under the covers, then you need to instruct it to not coerce null to 0 or 0.0 in case of Number types by the following VM argument (it's unintuitively dealing with Number types as if they are primitives):-Dorg.apache.el.parser.COERCE_TO_ZERO=false另见:空字符串的疯狂h:inputText绑定到 Integer 属性的提交值是 0 而不是 nullh:inputText绑定到 String 属性正在提交空字符串而不是 nulljavax.faces.INTERPRET_EMPTY_STRING_SUBMITTED_VALUES_AS_NULL 自 Java EE 7/EL 3.0 起不再起作用 这篇关于如何使数字输入区域最初为空而不是 0 或 0.00?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-04 02:38
查看更多