tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Reznik <>
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--)
-----Original Message-----
From: Shawn Bayern []
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
> 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]}" />

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]}" />

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

Shawn Bayern
"JSTL in Action"
(coming in July 2002 from Manning Publications)

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

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

View raw message