Trying a million more combinations, I finally figured
it out. These both return true (for a null param and
blank string param respectively):
<jx:if test="${empty(mynullparam)}">
<jx:if test="${empty(myblankparam)}">
Also, the problems I was having comparing params with
"==" and "!=" operators was due to the fact that they
were strings. I forgot that when dealing with strings
in java, one should use the "equals()" function.
Ex.
<jx:if test="${myblankparam.equals(''}">
resolves to true
<jx:if test="${mynullparam.equals(NULL}">
doesn't work...probably hits a null pointer exception
the generator
<jx:if test="${mynullparam == NULL}">
resolves to true
Another key thing I was missing is I was only putting
the brackets around the parameter, not the whole
expression. Oh well, lesson learned. Thanks for the
help.
Post by foothUgh...still the same problem. Would you expect this
to work?
<jx:if test="empty (null)">
<jx:if test="empty ('')">
I searched all the samples for the text "empty(" and
I
can't seem to find any examples. Any other
suggestions? I've spent way too much time on such a
simple logic statement. Doh!
Post by Mark LundquistPost by foothThanks for the reply but still no luck using
this
Post by Mark LundquistPost by footh<jx:if test="isEmpty (${mynullparam})">
<jx:if test="isEmpty (null)">
and
<jx:if test="isEmpty ('')">
Sorry, my bad... the function is 'empty', not
'isEmpty'! I remember
now that I'm looking at it in email :-/
ml
---------------------------------------------------------------------
Post by footh____________________________________________________
Start your day with Yahoo! - make it your home page
http://www.yahoo.com/r/hs
---------------------------------------------------------------------
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com