用<html:options collection="resultset" property="partCategory" labelProperty="partCategory"/>标签就可以循环取出集合中的元素了

解决方案 »

  1.   

    建议使用<html:optionsCollection>标签
      

  2.   

    用struts-el.jar可以解决你的问题<logic:notEmpty name="resultset">
           <logic:iterate name="resultset" id="row" >
              <html-el:option value="${row.partCategory}">
                    <bean:write name="row" property="partCategory" />
              </html-el:option> 
           </logic:iterate>        
    </logic:notEmpty>需要包struts-el.jar.
    具体实现参见struts1.2.3   http://jakarta.apache.org/
      

  3.   

    jsp:
    <html:select property="userinfoVO.vch_typeid">
         <html:optionsCollection property="typeList"/>
    </html:select>
    form:
    private Collection typeList = null;
    public Collection getTypeList() {
    return typeList;
    }
    public void setTypeList(Collection collection) {
    typeList = collection;
    }给typeList赋值的例子:
    ArrayList typeList = new ArrayList();for (int i = 0; i < uerTypeList.size(); i++) {
     Sz_usertypeVO tempVO = (Sz_usertypeVO) uerTypeList.get(i);
     typeList.add(new LabelValueBean(tempVO.getVch_typename(),tempVO.getVch_typei()));
    }
    form.setTypeList(typeList);
      

  4.   

    to 遥遥
    我试过你的方法了,好像不行,错误信息:
    [ServletException in:/pages/master/part/detail.jsp] No getter method available for property categoryCode for bean under name resultset'我的resultset类型是collection,里面放的是formbeans,现在就是从每个formbeans里面取相同字段的那些值。你的方法中collection="resultset",这个resultset好像必须是一个bean,有get方法。
      

  5.   

    是的,把resultset存成一个bean的arrayList就可以了