在struts1.2中 我们的FormBean怎么去对应页面的多选框(select);用list行吗。具体怎么操作。谢各位。

解决方案 »

  1.   

    <form-property name="sel" type="java.lang.String" />
    <form-property name="selID" type="java.lang.String[]" initial="1,2,3" />
    <form-property name="selVal" type="java.lang.String[]" initial="中国,美国,俄罗斯" /><html:select property>
       <html:options property="selID" labelProperty="selVal" />
    </html:select>
      

  2.   

    <form-property name="sel" type="java.lang.String" /> 
    <form-property name="selID" type="java.lang.String[]" initial="1,2,3" /> 
    <form-property name="selVal" type="java.lang.String[]" initial="中国,美国,俄罗斯" /> <form-property name="selID" type="java.util.ArrayList" initial="1,2,3" /> 
    <form-property name="selVal" type="java.util.ArrayList" initial="中国,美国,俄罗斯" /> <html:select property="sel"> 
      <html:options property="selID" labelProperty="selVal" /> 
    </html:select>
      

  3.   

    不好意思,多选框不是select吧,checkbox吧.
    使数组就可以了