我的例子给你看看:
ArrayList arraylist = new ArrayList();
HashMap hm = null;
while(rs.next()){
        hm = new HashMap();
        hm.put("id",rs.getString("stor_id"));
        hm.put("flag",rs.getString("ord_num"));
        hm.put("quantity",rs.getString("qty"));
        hm.put("description",rs.getString("payterms"));
        hm.put("fuser",rs.getString("ord_date"));
        arraylist.add(hm);      
}
httpServletRequest.setAttribute("finance",arraylist);
...<logic:iterate id="a" name="finance" offset="<%=offset.toString()%>" length="10">
         <tr><td ><bean:write name="a" property="id"/></td>
          <td ><bean:write name="a" property="flag"/></td>
          <td ><bean:write name="a" property="description"/></td>
          <td ><bean:write name="a" property="quantity"/></td>
          <td ><bean:write name="a" property="fuser"/></td></tr>
</logic:iterate>

解决方案 »

  1.   

    java.util.ArrayList list = new java.util.ArrayList();
        public class Uset(){
     private String name;
    private String  type;
     //写出set get 方法
    }
        for(int i=0;i<3;i++){
       User uu=New user();
           uu.setUserType("a");
           un.setUserName("b");
            list.add(un);
        }
       
        pageContext.setAttribute("list", list, PageContext.PAGE_SCOPE);
    <logic:present name="aa">
    <logic:iterate id="item" name="list"  > <bean:write name="item" property="userType" />
     <bean:write name="item2" property="userName" /></logic:iterate>
    </logic:present>
      

  2.   

    <logic:present name="aa">
    <logic:iterate id="item" name="list"  > <bean:write name="item" property="userType" />
     <bean:write name="item" property="userName" /></logic:iterate>
    </logic:present>
      

  3.   

    谢谢haroyy(天平),plusjava(目木) !不好意思,我没有说明白。这里的TypeName和UserName是不能合到一个对象中的,而且都add进了同一个list,现在就是要通过标签把里面的值取出来。
      

  4.   

    我们一般是定义一个继承ActionForm的类例如叫UserForm,在UserForm里定义 uerType,   userName
    再定义一个userList
      UserForm  userform=(UserForm)context.getActionForm();
      java.util.ArrayList list = new java.util.ArrayList();
      for(int i=0;i<3;i++){
       UserForm uu=New UserForm();
           uu.setUserType("a");
           un.setUserName("b");
            list.add(un);
        }
      userform.setUserList(list);
      context.setActionForm(userform);
      <logic:iterate name="userform" property="userList" indexId="nums" id="vo">
      <tr>
      <td > <%=nums.intValue()+1%></div></td>
      <td > <bean:write name="vo" property="uerType" ignore="true"/></div></td>
      <td> <bean:write name="vo" property="userName" ignore="true"/></div></td>        
      </tr>
      </logic:iterate>