struts2问题?怎样在页面能取到封装了多个对象中的属性?请求大侠指点
publicBeanUtil{privateEmployeeemp;privateDepartmentdepartment;....setters&gettersmeth...
public BeanUtil {
private Employee emp;
private Department department;
....setters & getters methods
}
public Employee{
private Integer empID;
private String empName;
pirvate String empAge;
setters & getters methods
}
public Department {
private String departName;
pirvate String departID;
setters & getters methods
}
-----
通过员工表和部门表联合查询
在action中
public ShowAction extends ActionSupport{
private List<BeanUtil > beanUtilList = null;
setters & getters methods of List<BeanUtil >
在execute方法中
this.beanUtilList = new myDao( ).UnionQuery( );
return Success;
在页面上怎样通过<s:iterator></s:iterator>来显示所有empName,empAge,departID,departName?
} 展开
private Employee emp;
private Department department;
....setters & getters methods
}
public Employee{
private Integer empID;
private String empName;
pirvate String empAge;
setters & getters methods
}
public Department {
private String departName;
pirvate String departID;
setters & getters methods
}
-----
通过员工表和部门表联合查询
在action中
public ShowAction extends ActionSupport{
private List<BeanUtil > beanUtilList = null;
setters & getters methods of List<BeanUtil >
在execute方法中
this.beanUtilList = new myDao( ).UnionQuery( );
return Success;
在页面上怎样通过<s:iterator></s:iterator>来显示所有empName,empAge,departID,departName?
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询