But Kris,when I tried to use JSTL for another requirement by using taglib
uri as
<%@ taglib uri="http://java.sun.com/jstl/core"; prefix="c" %> i get the error
that this taglib
cannot be located. I am not able to even see the page
"http://java.sun.com/jstl/core"; through browser .Browser shows me 'File not
found' . What can be the reason????

-----Original Message-----
From: Kris Schneider [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 05, 2003 1:52 AM
To: Struts Users Mailing List
Subject: Re: Newbie:Using two arrays in a <logic:iterate> tag


JSTL is your friend:

<c:forEach var="item" items="${anArray}" varStatus="i">
  <c:out value="${item}"/>
  <c:out value="${anotherArray[i.index]}"/>
</c:forEach>

Assuming "anArray" and "anotherArray" are scoped attributes...

Quoting Jitesh Sinha <[EMAIL PROTECTED]>:

> How do you access the elements of an array inside <logic:iterate> tag
which
> takes the collection as another array . I am sure that the length of the
> two
> arrays are same.
> In other word how do you substitute the following Java code in Struts :
>
> String[] anArray = myBean.getAnArray() ;
> String[] anotherArray = myBean.getAnotherArray() ;
> for(int i = 0 ; i < anArray.length ; i++)
> {
> out.print(anArray[i]) ;
> out.print(anotherArray[i]) ;
> }
>
> I want to use only one logic:iterate tag.Is that possible?
>
> Thanks,
> Jitesh

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