testing on empty string or null with jstl

2002-04-02 Thread Wim Bervoets
Hello, I have the following code: c:choose c:when test=(${param.yourName} != '') and (${param.yourEmail} != '') and (${param.friendsEmail1} != '') email something /c:when c:otherwise [c:out value=${param.yourName}/] [c:out value=${param.yourEmail}/] [c:out

Re: testing on empty string or null with jstl

2002-04-02 Thread peter lin
according to the specs, I believe EL will evaulate null value to zero length string. if you treat zero length string and null as the same condition, does that work for your situation? I'm a little confused by the example you provide. the first when checks to make sure name and email are not

Re: testing on empty string or null with jstl

2002-04-02 Thread Pedro Diaz
Hi. Try c:when test=${ (param.yourName != '') and (param.yourEmail != '') and (param.friendsEmail1 != '') } instead of c:when test=(${param.yourName} != '') and (${param.yourEmail} != '') and (${param.friendsEmail1} != '') Greetings Wim Bervoets wrote: Hello, I have the following code:

RE: testing on empty string or null with jstl

2002-04-02 Thread Wim Bervoets
Well, on the previous page (with the form post) there is a INPUT type=text maxLength=50 size=25 name=friendsEmail1 , so the parameter friendsEmail1 is probably in the http request (value: empty string but not null) empty string if the user didn't fill in anything offcourse... -- To

RE: testing on empty string or null with jstl

2002-04-02 Thread Lev Pelekh
Wim, I am new to JSTL, but I seems to me that your test expressions is malformed. According to A.2.1 of JSTL spec, mixing EL and text as part of an attribute concatenates the text and the results of EL evaluation. Furthermore, I think that only binary and operator is supported. Try using this