It seems that properties associated with form fields are never set to
null even if the submitted is empty. This would be ok if the property
was coerced into a String as i could simply check for an empty String.
The problem is different when it's coerced to an Integer or to a Double
because if the user submits an empty form field the page get's the
Integer or Double representing 0.
I've tracked the problem down to the TypeCoercer implementation. The
given implementation coerces null values into the default value of a
type. So if you want to coerce a null to a Double if return 0.0d instead
of just null.
I'm not sure if this is actually intended behavior and there's probably
an easy way through configuration or something to solve my use case or
if it's a bug.
Any ideas ?
- T5: Setting properties to null Hugo Palma
-