Struts2

Struts2的标签<s:checkboxlist直接使用复选框堆在一起,查到的解决方式大多是修改模板文件,搜索到最后发觉还是这种方式比较简便:

我的java对象:
class{
  int id;
 
  String description;
}

jsp:


  <table width="90%" height="100%" border="0">
<s:iterator value="acsAllList" status="stat">
<tr>
<td align=left>
  <s:checkboxlist name="acsSelList" value="acsSelList" list="id" listValue="description"/>
</td>
</s:iterator>
  </table>


其中:list="id"  就是value的值,
listValue="description" 就是显示的描述
value="acsSelList" 就是默认选中的列表
 

你可能感兴趣的:(html)