<table>
<logic:iterate id="book" name="CartForm" property="cart">
 <tr>
   <td><bean:write name="book" property="bookID"/></td>
   <td><bean:write name="book" property="bookName"/></td>
 </tr>
</logic:iterate>
</table>

解决方案 »

  1.   

    to hxzg001()
    javax.servlet.jsp.JspException: No getter method for property bookID of bean book
    但我查了CartBookObject 和 CartForm里面的所有set get方法都没错啊。在logic:iterate里加一个属性type="com.kong.shop.javabean.CartBookObject"也不行
      

  2.   

    <logic:iterate id="book" name="CartForm" property="cart">
     <tr>
       <td><bean:write name="bookID" property="CartBookObject.bookID"/></td>
       <td><bean:write name="bookName" property="CartBookObject.bookName"/></td>
     </tr>
      

  3.   

    不好意思写错了
    <logic:iterate id="book" name="CartForm" property="cart">
     <tr>
       <td><bean:write name="book" property="CartBookObject.bookID"/></td>
       <td><bean:write name="book" property="CartBookObject.bookName"/></td>
     </tr>
      

  4.   

    <logic:iterate name="classList" id="classes" scope="page" type="指定formbean路径"(这里)>
    <tr>
    <td><bean:write name="classes" property="classID"/></td>
    <td><bean:write name="classes" property="className"/></td>
    </tr>
    </logic:iterate>
      

  5.   

    <table>
    <logic:iterate id="book" name="CartForm" property="cart" type="指定formbean路径"(这里)>
     <tr>
       <td><bean:write name="book" property="bookID"/></td>
       <td><bean:write name="book" property="bookName"/></td>
     </tr>
    </logic:iterate>
    你的
      

  6.   

    你这里的id="book"在那里存储的?在取出数据并return mapping.findForward("success")前需要将fromBean储存的啊(equest.setAttribute("array", array);)!
    比如如下代码: try {
    ArrayList array = new ArrayList();
    conn = GetConnectionPool.getConnection();
    DBFactory disaplayUser = new DBFactory();
    ResultSet rs = disaplayUser.executeQuery(conn, strSQL);
    while (rs.next()) {
    ContactForm actionForm = new ContactForm();
    actionForm.setMobile(rs.getString("******"));
    array.add(actionForm);
    }
    request.setAttribute("array", array);
    return mapping.findForward("success");
    } catch (Exception ex) {
    logger.error("write data error:"+ex.getMessage());
    } finally {
    if (conn != null)
    conn = null;
    }