struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Siggelkow, Bill" <>
Subject RE: check for null collection
Date Thu, 29 Nov 2001 15:16:24 GMT
The way I do it is to create a variable using the bean:size tag that
represents the size of the collection ...
Then I check if that value is 0 as follows ... (in addition you might want
to also check if the collection is present as you are doing)

				<bean:size id="numReports"
				<logic:equal name="numReports" value="0">
					<p>No reports available.</p>

-----Original Message-----
From: Thinh Doan []
Sent: Wednesday, November 28, 2001 2:53 PM
To: Struts-User
Subject: check for null collection

I've defined the following collection but don't know how to use the logic
tag to check if it contains no data to display appropriate message:

<logic:present name="MEMBERS" scope="request">
<bean:define id="myArray" name="MEMBERS" type="java.util.TreeSet"

    	<logic:iterate id="member" name="myArray"

    <some logic to check for null "myArray">
             No members


Thanks in advance,


To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message