At 03:33 AM 4/10/2001, you wrote:
>I want to display the size of an Collection attribute of a Bean using
>Struts taglibs. I can use scriptlet but are there any other ways to do that?
>
>Regards,
>Thai
Based on a response from [EMAIL PROTECTED] to a bug I filed, it
appears you can use the bean:size tag to do what you want. Here is a
snipped from the bug tracking system that should illustrate getting the
number of elements into a bean. For your problem, you would then use
bean:write to display this item count in your HTML (instead of using
logic:equal to check the size).
! ------- Additional Comments From [EMAIL PROTECTED] 2001-03-30 16:20
-------
! I had a similar problem awhile ago and Craig created the bean:size tag. This
! can be used along with logic tags to do what you want.
!
! <bean:size id="numlineitems" name="userorderdetail"
property="orderLineItems"
! scope="request" />
! <logic:equal name="numlineitems" value="0" >
! <bean:message key="emptylist.noitemsinorder"/>
! </logic:equal>
! <logic:greaterThan name="numlineitems" value="0" >
! ...
! </logic:greaterThan>