My Environment is JSF 1.2(sun RI)+facelet+tomcat 6.0.16. There is an integer field in my web form. I monitored the submitted form using the tcpmon. The value is indeed empty. Debugging confirmed that the submitted value is empty. However, when it is "update model" in JSF, the value becomes Integer(0) while I expect a null object. I traced the code down to AstValue.setValue() line 1132: resolver.setValue(ctx, t.base, t.property, // coerce to the expected type ELSupport.coerceToType(value, resolver.getType(ctx, t.base, t.property))); which calls java/org/apache/el/lang/ELSupport.java line 198: public final static Number coerceToNumber(final Object obj) { line 199: if (obj == null) { line 200: return ZERO; The ELSupport here converts a null object to zero object. This makes it impossible to differentiate "an empty field" from "a field with 0" from web in JSF model object. Maybe the setValue in AstValue should be changed to resolver.setValue(ctx, t.base, t.property, value==null?null: ELSupport.coerceToType(value, resolver.getType(ctx, t.base, t.property))); thanks -jason
This behaviour us as oer the soec *** This bug has been marked as a duplicate of bug 43285 ***
Sorry about the typing. It should have said "as per the spec"