[jsr-314-open] Coercion in the EL

Martin Marinschek mmarinschek at apache.org
Sun Oct 18 07:32:07 EDT 2009


Hi Lincoln,

On 10/16/09, Lincoln Baxter, III <lincolnbaxter at gmail.com> wrote:
> I'm concerned... what implications does this have? Why is this
> something we should be fixing? This is a potentially dangerous thing
> to be tampering with IMO.

I think I explained why this is a problem - it is against the
"principle of least suprise": I don't expect, if I pass a null into an
EL expression in the managed-bean, to have a "false" coming out in the
attribute in my component. I expect the component author to be able to
pick a sensible default value if I pass null. Same with a string - I
don't expect an empty string if I pass null.

What happens now is that people are not passing nulls from EL
expressions, instead picking a default value themselves. It is most
certainly not a decent solution to place the burden of picking default
values on the web-app developer...

regards,

Martin




More information about the jsr-314-open-mirror mailing list