日期:2014-05-20 浏览次数:20953 次
try
{
ServicesImpl_F service=new ServicesImpl_F(); //调用Service
List<Department> list=service.getDepartment(); //service中一个返回部门信息列表的方法
System.out.println("共有"+list.size()+"个部门");
List<LabelValueBean> deptlists=new ArrayList<LabelValueBean>();
for(int i=0;i<list.size();i++)
{
String bmbh=list.get(i).getBmbh();
String bmmc=list.get(i).getBmmc();
deptlists.add(new LabelValueBean(bmbh,bmmc));
}
this.setDepts(deptlists); //depts是一个List集合变量,返回给JSP界面的<html:options>控件
}
catch(Exception e)
{
System.out.println(e);
e.printStackTrace();
}