要这么麻烦吗?还不如自己做一个TAG!

解决方案 »

  1.   

    使用<html:optionsCollection>标签
    1)在ActionForm中加入字段
        private List cityList=new ArrayList();
    2)加入必须的getter方法
    public List getCityList() {
    return cityList;
    }
    3)在reset方法内给cityList填充内容
        cityList.add(new LabelValueBean("北京市","010"));
        cityList.add(new LabelValueBean("广州市", "020"));
        cityList.add(new LabelValueBean("上海市", "021"));
    4)JSP标签中使用
    <html:select property="city2">
    <html:optionsCollection property="cityList" label="label" value="value"/>
    </html:select>
      

  2.   

    <html:form action="" >
      <html:select property="tt" >
      <logic:iterate id="bbc" name="array">
      <option value="${bbc}"><bean:write name="bbc"/></option>
      </logic:iterate>
      </html:select>
      </html:form>
      

  3.   

    怎么都搞的这么麻烦。。
    如果数组是Form的一个属性就用<html:options property=""/>
    如果是用request.setAttribute()放在request里的就用<html:options name=""/>
      

  4.   

    <html:form action="" >
     <html:select property="tt" >
     <logic:iterate id="bbc" name="array">
     <option value="${bbc}"><bean:write name="bbc"/></option>
     </logic:iterate>
     </html:select>
     </html:form>
    这个方案不错