tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Reznik <rez...@ORsoftware.com>
Subject RE: Compress the HTML code
Date Mon, 15 Jul 2002 19:49:17 GMT
Thank You, 
both ways work correctly, 
my idea was to write an equivalent of something like this:
for(int i=0, int j=0; i<10, j>20;i++;j--)
alex
-----Original Message-----
From: Shawn Bayern [mailto:bayern@essentially.net]
Sent: Monday, July 15, 2002 3:38 PM
To: Tag Libraries Users List
Subject: RE: Compress the HTML code


On Mon, 15 Jul 2002, Alex Reznik wrote:

> If i were to iterate over two sets of parameters, is there a way to
specify
> their values within one forEach loop?

It depends on what you really want to do.  You can iterate over numbers
and apply them as indices over two arrays or List objects, like this:

  <c:forEach var="i" begin="0" end="${end}">
    <c:out value="${a[i]}" />
    <c:out value="${b[i]}" />
  </c:forEach>

Or you can iterate over one array and use 'count' from 'varStatus' as the
index into another:

  <c:forEach items="${a}" var="aItem" varStatus="s">
    <c:out value="${a}" />
    <c:out value="${b[s.count]}" />
  </c:forEach>

If you're looking for something else, please feel free to clarify.  Hope
this helps,

-- 
Shawn Bayern
"JSTL in Action"   http://www.jstlbook.com
(coming in July 2002 from Manning Publications)


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

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