<select name='sel' mutiple=true>
...
</select>
直接提交到后台,返回一个字符数组

解决方案 »

  1.   

    在struts 架构中,具体如何?
      

  2.   

    1楼的正解,如果你问Form怎么设,当然就是用String[]作参数的类型啦
      

  3.   

    基本搞定了,不过可以看看jdon上面的一篇关于html:options的文章,我想知道如果struts页面中一个html:form 嵌套另一个html:form可不可以,像下面这样:
      <tr bgcolor="#C8DAEC">
               <td>
                    <bean:define id="services" name="servicecatalogForm"/>
                     <html:select property="leftselectedvalue" multiple="multiple">
                        <html:options collection="services"
                               property="unselservicesvalue"
                               labelProperty="unselserviceslabel"/>
                    </html:select>
                 </td>
              <html:form name="ServiceLocationForm" action="ServiceLocationAction.do" >
              <td> <html:button value="增加 " property="addservice" />
                <br> <html:button value="删除 " property="delservice" />
     <html:submit value="配置服务" property="Configuration" />
                &nbsp;&nbsp; <html:reset value="重 置" property="Reset"/>
              </td>          <td>
          <bean:define id="services" name="servicecatalogForm"/>
          <html:select multiple="multiple" property="selservicesvalue" size="8">
                  <html:option value="">选择以下类别</html:option>
          <html:options collection="services" property="pastservicesvalue"  labelProperty="pastservcieslabel" />
                  </html:select>
                </td>
      </html:form>
            </tr>页面中最初两列表值从servicecatalogForm中得到,当点“增加”/“删除”按钮时,左侧服务被选中项目会移到右侧并减少,右侧列表自动增加该服务/或反之,这里我拿不准,是通过javascript实现,还是提交到action中去实现,最后点击“配置服务”将整个页面提交到ServiceLocationAction中处理