当前位置: 代码迷 >> Java Web开发 >> 关于Struts Map-backed Actionforms 的有关问题,用
  详细解决方案

关于Struts Map-backed Actionforms 的有关问题,用

热度:541   发布时间:2016-04-17 13:21:53.0
关于Struts Map-backed Actionforms 的问题,急用!
在Struts   中使用   Map-backed   Actionforms   无法获取多选项的值,只能获取到选中的第一个值,不知是什么原因,望高手指点   ~~~~~

------解决方案--------------------
struts 的动态actionform接收 多个复选框的值
在struts-config.xml中
<form-bean name= "tryidactionform "
type= "org.apache.struts.action.DynaActionForm ">
<form-property name= "checkbox " type= "java.lang.String[] "> </form-property>
</form-bean>
在页面表单中复选框的名字对应为checkbox,并且表单用 <html:form> </html:form>
然后在action中,String[] items = (String[])form.get( "checkbox ");
这样就可以了~
详情请看我上次发的帖
http://community.csdn.net/Expert/topic/5665/5665352.xml?temp=.871731
------解决方案--------------------
上楼好象没明白我的问题,我用的ActionForm 并不是DynaActionForm而是使用Map-backed ActionForm
  相关解决方案