> From: Sergei P. Volin [mailto:[EMAIL PROTECTED] 
> I have a set of arrays of the same length and i want to 
> iterate over all of them in a turn. 
> So what is the best practice to do this?
> Is there any direct method of direct acces to the element of an array?
> Like this: <c:out value="$myArray[i]">

Are you sure this is the best design?  If the arrays belong together,
then they probably shouldn't be lying around loose.  Are they properties
of some object?

If this is the best design (or you can't change it), I think you can use
the 'varStatus' of <c:forEach> to address the other arrays.  Off the top
of my head, and probably not quite correct...

<c:forEach items="${firstArray}" var="myItem" varStatus="myLoopIndex">
    <c:out value="${myItem}"/>
    <c:out value="${secondArray[myLoopIndex]}"/>
    <c:out value="${thirdArray[myLoopIndex]}"/>
</c:forEach>

It might need single quotes around 'myLoopIndex'.  Or not, play around
with it and see what works!

-- 
Wendy Smoak
Application Systems Analyst, Sr.
ASU IA Information Resources Management 

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

Reply via email to