Eric.  Good points; some comments below.

On Fri, 15 Mar 2002 [EMAIL PROTECTED] wrote:

> I see JSTL as a kind of "read-only" interface to your data,
> effectively implementing the View in the MVC model. Frankly, I
> wouldn't want our web designers to be able to call methods other than
> getters. However, it still would be really helpful to have a
> standardized method of getting the number of objects without having to
> go through a <c:forEach>. Let's say e.g. you want to show a table, but
> only if you really have table rows to show. Right now I always have to
> implement a getNumberOfRows method.

You could just throw in the <c:forEach> loop; in Beta 1, if your
collection doesn't contain any items, the loop will simply skip over it.

By the way, what, exactly, do you mean by "standardized method of getting
the number of objects without having to go through a <c:forEach>".  Are
you suggesting that there should be some way to call size() for an object
in the Collections framework, or something more general?  And does
<c:forEach>'s new, "collapsible" behavior ("simply don't iterate if
nothing's there") address this issue for you?

--
Shawn Bayern
Author, "JSP Standard Tag Library"  http://www.jstlbook.com
(coming this summer from Manning Publications)


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to