在ACTION中将得到的记录转集合类型,并设入属性,如下:
ArrayList result= new WorkDbOperate().getAppraiseList();
request.setAttribute("result", result);在JSP页面中:
<logic:iterate id="resultlist" name="result">
<TR>
<TD><bean:write name="resultlist" property="你的字段名mobile" /></TD>
</TR>
</logic:iterate>

解决方案 »

  1.   

    如果你用扩展标签,可以这么写:
    <td class="ListTdData">
      <html-el:text property="price" value="${EquipFetchreceiptsVOE.price}"     maxlength="28" size="25"  styleClass="Listinput"  />
    </td>
    其中EquipFetchreceiptsVOE是一个bean
      

  2.   

    如果你只是显示单一字段的话,可以不用写bean,把字段放在String[]里或List里都可...
    1.action(简写)
    //求字段mobile的个数
    String sql = "select count(*) from yourtable where 条件";
    rs = stmt.executeQuery(sql);
    rs.next();
    //strArray为mobile字段的集合
    String[] strArray=new String[rs.getInt(1)];
    sql = "select mobile from yourtable where 条件";
    rs = stmt.executeQuery(sql);
    int i=0;
    while (rs.next()) {
    strArray[i]=rs.getString("mobile");
    i++;
    }request.setAttribute("myList",strArray);
    //转发到显示moble字段列表的页面
    return mapping.findForward("success");
    2.显示moble字段列表的页面
    <%
    //下面这个myList数组你可用来测试
    //String[] myList = {"a","b","c","d"};
    String[] myList = (String[])request.getAttribute("myList");
    %>
    <logic:iterate id="currentInt" collection="<%=myList %>" type="java.lang.String"> 
    <%=currentInt %> 
    </logic:iterate>