**.java
pubic String test(Model model,User user,HttpServletRequest request,HttpServletResponse response,String channel) {
List<User> ctList = querylist(channel);
String s= tntProm.getDistributor();
List<String> list = new ArrayList<String>();
if(s!=null && !s.equals("")) {
String[] s = s.split(",");
for(String temp : s) {
if(temp != null &&temp.length() != 0){
list.add(temp);
}
}
}
Map<String, String> map_id = new HashMap<String, String>();
String tempId = "";
String tempName = "";
for(int i = 0;i<ctList.size();i++) {
tempId = String.valueOf(ctList.get(i).getUserId());
tempName = ctList.get(i).getRealName();
map_id.put(tempId,tempName);
}
user.setList(list);
model.addAttribute("user", user);
model.addAttribute("map", map_id);
return "/test/edit";
}
.jsp
<table >
<tbody>
<tr>
<td>关键词:</td>
<td><sf:input path="key" onfocus="this.blur()"/></td>
</tr>
<tr>
<td>ID:</td>
<td><sf:input path="id" id="id"/></td>
</tr>
<tr>
<td><span>渠道: </span></td>
<td><sf:checkboxes items="${map}" path="list" cssClass="required"/></td>
</tr>
</tbody>
</table>