使用Struts2的iterator标签轻松遍历复杂的Map类型

来源:互联网 发布:saas mysql数据库设计 编辑:程序博客网 时间:2024/06/05 06:24
1.创建一个Web工程,添加Struts2支持。
2.创建两个实体类:
a). Mother(母亲)的Java类。
package struts.map.entity;

import java.io.Serializable;

public class Mother implements Serializable {

private static finallong serialVersionUID= 1L;

private int motherId;       //母亲ID
    private String motherName;       //母亲名字
    publicint getMotherId() {
return motherId;
}
public void setMotherId(int motherId) {
this.motherId= motherId;
}
public String getMotherName() {
return motherName;
}
public void setMotherName(String motherName) {
this.motherName= motherName;
}
}

b).Children(孩子)的Java类

 

原文:http://www.blogjava.net/zyw090111/archive/2010/08/26/330017.html

原创粉丝点击