tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Wim Bervoets <wim.bervo...@iconmedialab.com>
Subject RE: testing on empty string or null with jstl
Date Tue, 02 Apr 2002 15:27:24 GMT
Thanks that did the trick :-)

Wim

> -----Original Message-----
> From: Pedro Diaz [mailto:pedro.diaz@bancoval.es]
> Sent: dinsdag 2 april 2002 17:20
> To: Tag Libraries Users List
> Subject: Re: testing on empty string or null with jstl
> 
> 
> 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:
> >
> > <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 value="${param.friendsEmail1}"/>]
> >         [<%=request.getParameter("yourName")%>]
> >         [<%=request.getParameter("yourEmail")%>]
> >         [<%=request.getParameter("friendsEmail1")%>]
> > </c:otherwise>
> > </c:choose>
> >
> > If the request paramaters are not empty I would like to 
> send a mail - eg.
> > execute the when.
> > - otherwise execute the otherwise.
> >
> > Problem I have is that c:otherwise is always executed - 
> even when the
> > parameters are set (I can see they are set because of the c:out's)
> >
> > So how can I check for an empty string or null ? 
> ${param.yourName} != null
> > or ${param.yourName} != '' doesn't work !
> > I'm using resin 2.0.5  - maybe it has something todo with 
> the forEach
> > problem that was fixed recently in resin 2.1.0 ?
> >
> > Thanks
> > Wim
> >
> > --
> > To unsubscribe, e-mail:   
<mailto:taglibs-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:taglibs-user-help@jakarta.apache.org>

--
         ----------
             |  Pedro Javier Díaz
             |  Técnico de Alioth S.A.
             |
             |     "¿Y tú, te reunes o trabajas?"
              ------------------------------------



--
To unsubscribe, e-mail:
<mailto:taglibs-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:taglibs-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:taglibs-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:taglibs-user-help@jakarta.apache.org>


Mime
View raw message