假設您「鏈接」它們與索引,你可以使用IteratorStatus喜歡如下:
<s:iterator value="userPics" var="pics" status="ctr">
Current Element from userPics: <s:property value="pics" />
Current Element from picLikes: <s:property value="picLikes[%{#ctr.index}]" />
</s:iterator>
但它會更好,10次創造與這兩個屬性的對象,和列表其中:
public class Picture {
private byte[] picture;
private int likes;
/* getters and setters */
}
然後在動作:
private List<Picture> pics;
/* getter and setter */
並最終在您的JSP中:
<s:iterator value="pics">
Current Element from userPics: <s:property value="picture" />
Current Element from picLikes: <s:property value="likes" />
</s:iterator>
它們如何相互鏈接? – 2014-11-05 09:19:21