You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ciaran Hanley <ci...@sentenial.ie> on 2004/02/19 15:21:58 UTC

nested logic:iterate with logic:equal

Can anybody help me with this problem?

 

I have two arraylists of beans in my session, I am trying to iterate through
them and when an element in one bean equals an element in the second bean
print it out

 

<logic:iterate id="ElementOne" name="currentElementOneValues">

  <logic:iterate id="ElementTwo" name="currentElementTwoValues">

    <logic:equal ????????????? >

      <bean:write name="ElementOne" property="value"/>

    </logic:equal>

  </logic:iterate>

</logic:iterate>

 

I'm not sure how the logic:equal would work

 

 

The java would be something like:

 

for(int i = 0; i < elementOneValues.size(); i++)

{

   for(int j = 0; j < elementTwoValues.size(); j++)

   {

      if((((ElementOne)
elementOneValues.get(i)).eTwoID).equals(((ElementTwo)
elementTwoValues.get(j)).ID))

      {

         System.out.println((ElementOne)
elementOneValues.get(i)).getValue());

      }

   }

}

 

 

Thanks,

Ciaran