public class DropDownListBean {
private String id;
private String name;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
}
2、在service业务逻辑层中,要有dropdownlist数据源list的get和set方法:
public class ToDepartmentUpdatePageAction extends ActionSupport {
/**
*
*/
private static final long serialVersiOnUID= 1L;
private DepartmentBean departmentBean;
private List list = new ArrayList();
private int id;
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
@Resource
private IDepartmentManage departmentManage;
public DepartmentBean getDepartmentBean() {
return departmentBean;
}
public void setDepartmentBean(DepartmentBean departmentBean) {
this.departmentBean = departmentBean;
}
public IDepartmentManage getDepartmentManage() {
return departmentManage;
}
public void setDepartmentManage(IDepartmentManage departmentManage) {
this.departmentManage = departmentManage;
}
public List getList() {
return list;
}
public void setList(List list) {
this.list = list;
}
@Override
public String execute() throws Exception {
setDepartmentBean(departmentManage.getDepartments0(" where nid = "+id).get(0));
List tmpList=departmentManage.getddlDepartments();
for (int i = 0; i
3、在jsp页面中获取list数据源以及bean对象: