tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Shawn Bayern <bay...@essentially.net>
Subject Re: set Collection size
Date Thu, 05 Sep 2002 17:09:37 GMT
On Thu, 5 Sep 2002, Thomas Colin de Verdière wrote:

> But you can write a JavaBean Info. You define a property 'size' and
> you call its read method size() which EL will find (am i right or not)

You can do this on your own custom objects.  When encountering a
Collection, however, the JSTL EL (and the preliminary JSP 2.0 EL) treats
it as a Collection, not a JavaBean.  Thus, the JavaBean properties you add
to the Collection via a BeanInfo class have no effect on the EL.

The ideal thing to do, if you're designing your own data model, is to
provide a wrapper for the Collection that looks something like this:

  public Collection getItems();
  public int getSize();

-- 
Shawn Bayern
"JSTL in Action"   http://www.jstlbook.com


--
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