Remember that "${bean.property}" maps to "bean.getProperty()" so arraylist.size doesn't do the trick.

At 08:36 25/05/2004 -0400, you wrote:
It looks like you're using JSTL 1.1 so you can use its length function:

<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"; %>

${fn:length(requestScope.newStarters)}

Quoting Allistair Crossley <[EMAIL PROTECTED]>:

> Hi guys, simple but annoying problem .. have been following documentation but
> does not happen for me. I have a ArrayList in the request as "newStarters". I
> have tried the following:
>
> Attempt 1
> =========
>
> <%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
>
> <c:forEach var="newStarter" items="${requestScope.newStarters}">
> x
> <br />
> </c:forEach>
>
> Attempt 2
> =========
>
> <%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" %>
>
> <jsp:useBean id="newStarters" class="java.util.ArrayList" scope="request" />
> <%= newStarters.size() %>
>
> <c:forEach var="newStarter" items="${requestScope.newStarters}">
> x
> <br />
> </c:forEach>
>
> In this attempt I output the size of my collection and it is 10. I would
> interested how to output the size using EL too. I tried
>
> <c:out value="requestScope.newStarters.size" />
>
> Can anyone help
>
>
> <FONT SIZE=1 FACE="VERDANA,ARIAL" COLOR=BLUE>
> -------------------------------------------------------
> QAS Ltd.
> Developers of QuickAddress Software
> <a href="http://www.qas.com";>www.qas.com</a>
> Registered in England: No 2582055
> Registered in Australia: No 082 851 474
> -------------------------------------------------------
> </FONT>


--
Kris Schneider <mailto:[EMAIL PROTECTED]>
D.O.Tech       <http://www.dotech.com/>

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



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



Reply via email to