1,javaBean
public class Test {
private int id;
private String sName;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getSName() {
return sName;
}
public void setSName(String name) {
sName = name;
}
}
2,jsp页面
<s:iterator value="list1" id="Test">
<!-- 用<s:set 定义一个变量,并赋值 -->
<s:set name="listId" value="id" />
<s:iterator value="list2"id="Test">
<!-- 用#变量名取得值 -->
<s:if test="id==#listId">
<tr><td><s:property value="sName"/></td></tr>
</s:if>
</s:iterator>
</s:iterator>