下面是实现的实例:
《Struts单选框的实现》
《Struts复选框的实现》
《Struts下拉框的实现》http://dev.csdn.net/user/kui
http://javaweb.51.net/
http://javawebStudio.51.net/下载《Struts开发实例》地址:
http://www.infoxa.com/asp/book/xxnr.asp?id=1333

解决方案 »

  1.   

    建议用 multibox
    <html:multibox name="all" property="checkbox">
    <bean:write name="all" property="userID"/>
    </html:multibox>
      

  2.   

    这样不行呀
    出错了!You must specify the value attribute or nested tag content
      

  3.   

    你userid有值吗?我那样写应该是没问题的。
      

  4.   

    <%@ page contentType="text/html; charset=GB2312" %>
    <%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
    <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
    <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
    <jsp:useBean id="userBean" scope="page"  class="zhangbo.UserBean"/>
    <c:set var="user" value="${userBean.user}"/>
    <html:html locale="true">
    <head>
    <title>无标题文档</title>
    <html:base/>
    <style type="text/css">
    <!--
    a:link {
    text-decoration: none;
    }
    a:visited {
    text-decoration: none;
    }
    a:hover {
    text-decoration: underline;
    }
    a:active {
    text-decoration: none;
    }
    -->
     <!--
          .style1 {font-size: 12px}
          body,td,th {
          font-size: 12px;
          }
        -->
    </style></head>
    <body>
    <html:form action="deleteUserAction.do" method="get">
    <div align="center">
      <table width="681" height="69" border="1" bgcolor="#dff1f9">
        <tr>
          <td height="28"><div align="center"><bean:message key="struts.addjsp.userId"/></div></td>
          <td width="101"><div align="center"><bean:message key="struts.addjsp.userName"/></div></td>
          <td width="91"><div align="center"><bean:message key="struts.addjsp.age"/></div></td>
          <td width="91"><div align="center"><bean:message key="struts.addjsp.sex"/></div></td>
          <td width="158"><div align="center"><bean:message key="struts.addjsp.email"/></div></td>
          <td width="118"><div align="center"><bean:message key="struts.addjsp.qq"/></div></td>
          <td width="118"><div align="center">删除用户</div></td>
        </tr>
        <logic:iterate id="all"  name="user">
          <tr>
          <td width="82" height="28"><div align="center"><bean:write name="all" property="userId"/></div></td>
          <td><div align="center"><bean:write name="all" property="userName"/></div></td>
          <td><div align="center"><bean:write name="all" property="age"/></div></td>
          <td><div align="center"><bean:write name="all" property="sex"/></div></td>
          <td><div align="center"><bean:write name="all" property="email"/></div></td>
          <td><div align="center"><bean:write name="all" property="qq"/></div></td>
          <td width="118">
          <div align="center">
          <html:multibox property="deleteId" >
          </html:multibox>
          </div></td>
          </tr>
        </logic:iterate>
      </table>
        <html:submit property="action">
        <bean:message key="struts.addjsp.button.add"/>
        </html:submit>
        <html:reset property="action" value="重置">
        </html:reset>
    </div>
    </html:form>
    </body>
    </html:html>有啊值是丛这个all集合读出的
      

  5.   

    用表达试就可以了自己搞定了!
    <html:multibox name="all" property="checkbox" value="${all.userId}">
    </html:multibox>
      

  6.   

    搞不明白和我的有什么不一样 你不会是把我的原封拷贝了吧 我的那写的是userID
      

  7.   

    没有
    我也不知道?
    <html:multibox name="all" property="checkbox">
    <bean:write name="all" property="userId"/>
    </html:multibox>
    这样就抱错;You must specify the value attribute or nested tag content
    这样就满好?
    <html:multibox name="all" property="checkbox" value="${all.userId}">
    </html:multibox>
      

  8.   

    哦~那也许是我们的ActionForm不一样