Struts: Iterate through array of javabeans
Posted on 2006-04-13
I create an array of JavaBeans called "beanProduct" and it is set into session. Afterwards I want to display the products in a JSP using logic:iterate, but I'm quite new to struts and logic:iterate. So ... how do I do this?
Before I made a little test with 1 javabean (NOT an array) and then displaying the stuff like this (simplified version):
<jsp:useBean id="beanProduct" scope="session" class="business.BeanProduct" />
<td><bean:write name="beanProduct" property="pro_name"></td>
<td><bean:write name="beanProduct" property="pro_description"></td>
<img src="<html:rewrite page='<%=beanProduct.getProductPicture()%>'/>"
OK, this works, but now I have an ARRAY of javabeans called "beanProduct". How do I implement the logic:iterate? Please notice that, for the image I used beanProduct.getProductPicture(), because apparently you can't nest <bean:write...> there.