tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Bickford <>
Subject Subtracting 2 values from different collections using <for:each> and el
Date Thu, 12 Feb 2004 20:35:38 GMT
In a nutshell, I want to iterate over a collection and subtract a value 
from a different collection with the same position as the current 
collection.  The problem is, I don't know how to reference the current 

For example, how would I do something like this:

        int[] a =  {0,1,2,3,4,5,6,7,8,9};
        int[] b =  {9,8,7,6,5,4,3,2,1,0};
        for(int i = 0; i < a.length; i++){

How could I achieve that in JSTL using el?
    <c:forEach var="total" items="${dailyTotals}">
                  <c:out value="${total-(value in another collection 
with the same index as this loop)}"/>

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message