You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ajay Patil <ap...@vertex.co.in> on 2003/12/11 06:56:03 UTC

[OT] Using to test if collection is empty

Hi,

I am trying to use the JSTL tag to test if a collection is empty.

In terms of java code, I would like to write..

if (products != null && products.size() > 1) {
 ..
}

I have written the following in the JSP.

<c:if test={! empty products}>
 ...
</c:if>

The above isnt working. The test always fails even if the
products collection has size >= 1.

It will be of great help to me, if someone can point out the
correct way of writing the tag.

Thanks,
Ajay


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


Re: [OT] Using to test if collection is empty

Posted by Kris Schneider <kr...@dotech.com>.
<c:if test="${! empty products}">
...

Quoting Ajay Patil <ap...@vertex.co.in>:

> Hi,
> 
> I am trying to use the JSTL tag to test if a collection is empty.
> 
> In terms of java code, I would like to write..
> 
> if (products != null && products.size() > 1) {
>  ..
> }
> 
> I have written the following in the JSP.
> 
> <c:if test={! empty products}>
>  ...
> </c:if>
> 
> The above isnt working. The test always fails even if the
> products collection has size >= 1.
> 
> It will be of great help to me, if someone can point out the
> correct way of writing the tag.
> 
> Thanks,
> Ajay

-- 
Kris Schneider <ma...@dotech.com>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org