Thanks Craig. I realize that it doesn't work because of the naming issue but I was wondering if there was an easy way around it. Subclassing is certainly an option, would this be a useful method to add to the commons FastArrayList?

Dave






From: "Craig R. McClanahan" <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: Struts Users Mailing List <[EMAIL PROTECTED]>
Subject: Re: [OT] Getting a Collection's size in JSTL
Date: Wed, 30 Oct 2002 09:40:10 -0800 (PST)



On Wed, 30 Oct 2002, David Graham wrote:

> Date: Wed, 30 Oct 2002 09:13:49 -0700
> From: David Graham <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: [OT] Getting a Collection's size in JSTL
>
> Sorry for the OT post but the java forum was unresponsive. How do you get
> the size of a collection class in the JSTL EL?
>
> You can do it with jsp expressions like:
> <%= collection.size() %>
>
> but I want to do something like
>
> <c:if test="${collection.size > 0}">
>

This does not work because the size() method does not follow the naming
pattern required for JavaBean properties (where it would be getSize()).

One option would be to make yourself a subclass of things like ArrayList
that simply delegated everything, but added a getSize() method that calls
size() under the covers.

> I've tried every variation on that syntax that I could think of.
>
> Thanks,
> David
>

Craig


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

_________________________________________________________________
Surf the Web without missing calls! Get MSN Broadband. http://resourcecenter.msn.com/access/plans/freeactivation.asp


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

Reply via email to