You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by "David M. Karr" <dm...@earthlink.net> on 2002/09/02 06:26:39 UTC
Diff. between logic:equals and EL "eq" between null and ""
I noticed that with the Struts "logic:equal" tag, if you're comparing a
null-valued property with "", it returns true. This is not unexpected, as the
documentation specifically states that a null property value is coerced to a
zero-length string before a comparison occurs.
However, in the JSTL, with an EL expression, comparing a null-valued scoped
variable with 'eq ""', it appears to return false. This is curious, as I
noticed the statement in the JSTL spec in section A.7.1, titled "Coerce A to
String", which says 'Otherwise, if A is null: return "".' If this is true,
this would imply that comparing a null-valued SV against "" would return true.
Is there something wrong here, either with the implementation or the spec?
--
===================================================================
David M. Karr ; Java/J2EE/XML/Unix/C++
dmkarr@earthlink.net
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>