I have a logic:iterate block in my JSP file that needs to iterate over two Collections (ArrayList) simultaneously. That is:
<logic:iterate id="products" name="displayProductsForm"
property="productId" scope="session">
<LI><a href="
http://www.mydomain.com/myprog.cgi?p_id=<bean:writ
e name="products" property="productId" />"> <bean:write name="products" property="productName" /></a></LI>
</logic:iterate>
Problem is, the "property" attribute in the bean:write tag is in error (I put it in to try to describe what I am trying to do.) In other words, my ActionForm class has two ArrayLists (productName and productId) and I want to put a value from each in this single HTML line. As you can see, the user will see a product name link which, when clicked on, will take them to a product description page passing the product ID to a cgi script.
How do I code the iterate block? I can iterate over one property, but not two. As you're no doubt aware, I'm pretty new to Struts.
Start Free Trial