1.action
//查询所有权限
public String fuquanxian(){
try {
list = qx_Services.findquanxian("from RoleFunction where role.rid ='"+role.getRid()+"'");
ylist = qx_Services.findquanxian("from Function");
int ii=0;
fid = new Long[list.size()];
for(int i=0;i<list.size();i++){
rf = (RoleFunction)list.get(i);
System.out.println(rf.getFunction().getFid());
fid[ii++] = rf.getFunction().getFid();
}
} catch (RuntimeException e) {
e.printStackTrace();
}
return "fqx";
}
.jsp
<td><s:checkboxlist list="ylist" listKey="fid" listValue="fname" name="fid"></s:checkboxlist></td>
2.controller
//得到该教师已经教授的班级
List<Integer> clazz = ugmDAO.getGidByuId(uinfo.getId());
inv.addModel("clazz", clazz);
.vm
#foreach($!c in $!{g.giL})
<label>
<input #if($clazz.contains($!c.id)) checked #end type="checkbox" name="cids" value="$!{c.id}"/> $!{c.groupName}
</label>
#end