I need to convert null
property values of type java.math.BigDecimal
to 0.00
everywhere with a specified number of decimal places (only for
This is specific to the Mojarra. The problem occurred because the converter is not called when the value is null (see source here). I tested the same code in the MyFaces implementation and the result is that the convert is always called, no matter if the value is null (as can be seen here, line 378).
So if change JSF implementation is not an option, I think the solution through OmniFaces is good enough. At worst, maintain a function that makes the conversion like #{convert(bean.value)}
may leave cleaner your view than an inline comparison.