应该是bean,比如在action中request.setAttribute("result",result);

解决方案 »

  1.   

    id 是哪个bean,name是你的formbean 的名字,你弄混了,
      

  2.   

    <logic:iterate id="user" name="userForm" property="XXXXXX">
    你得加上property属性才行,这样iterate才知道把你form里什么东西拿来做循环,比如arraylist什么的.
      

  3.   

    <logic:iterate id="user" name="userForm" >
    <bean:write name="user" property="UserID" />
    这两个name指的是同一个bean吧
    对于property属性,不知道加什么了,我加了一个数据库里面的字段,提示说:No getter method for property users of bean userForm
      

  4.   

    我的UserForm是这样的:我的property属性该怎么写?!
    package com.sunw.Form;import javax.servlet.http.HttpServletRequest;import org.apache.struts.action.ActionForm;
    import org.apache.struts.action.ActionMapping;
    import org.apache.struts.action.ActionErrors;
    import org.apache.struts.action.ActionError;public class UserForm extends ActionForm { protected int UserID;
    protected String UserName;
    protected String UserSex;
    protected String UserEmail; public void setUserID(int UserID) {
      this.UserID = UserID;
    }
    public int getUserID() {
      return UserID;
    }
    public void setUserName(String UserName) {
      this.UserName = UserName;
    }
    public String getUserName() {
      return UserName;
    } public void setUserSex(String UserSex) {
      this.UserSex = UserSex;
    }
    public String getUserSex() {
      return this.UserSex;
    } public void setUserEmail(String UserEmail) {
      this.UserEmail = UserEmail;
    }
    public String getUserEmail() {
      return UserEmail;
    }
      // This method is called with every request. It resets the Form
      // attribute prior to setting the values in the new request.
      public void reset(ActionMapping mapping, HttpServletRequest request) {    this.UserID = 0;
        this.UserName = "";
        this.UserSex = "";
        this.UserEmail = "";
      }  public ActionErrors validate(ActionMapping mapping,
        HttpServletRequest request) {    ActionErrors errors = new ActionErrors();
        if ( (UserName == null) || (UserName.length() == 0) ) {      errors.add("UserName", new ActionError("errors.UserName.required"));
        }
        if ( (UserSex == null) || (UserSex.length() == 0) ) {      errors.add("UserSex", new ActionError("errors.UserSex.required"));
        }
        if ( (UserEmail == null) || (UserEmail.length() == 0) ) {      errors.add("UserEmail", new ActionError("errors.UserEmail.required"));
        }
        return errors;
      }
    }
      

  5.   

    楼主这个问题简单
    我也遇到过
    logic:iterate标签中你的name用错了
    不应该是actionForm,而应该是
    request.setAttribute("aaa",list);
    大概你的意思是要显示所有数据
    所以你这个list要用数组表示,aaa放到你的logic标签中
    <logic:iterate id="a" name="aaa">
    就可以了
    这个id可以自己随便写,
    但是下面的
    bean:write中的name就是这个id,
    例如:<bean:write name="a" property=""/>
      

  6.   

    你的form里面哪有collectoin来做iterate啊,只有一些String嘛
      

  7.   

    其实楼上说的form中要collection来着iterate
    没有必要的
    注意:id="findalltrainhead"这个id自己可以随便定义,要和<bean:write name="findalltrainhead" property="deptName"/>中的name一致。
      <logic:iterate id="findalltrainhead"  name="findalltrainheadresult" >
          <tr>
            <td nowrap bgcolor="#CCCCCC">
     </td>
            <td height="31" nowrap bgcolor="#CCCCCC">
                   &nbsp;</td>
            <td bgcolor="#CCCCCC">
     <bean:write name="findalltrainhead" property="deptName"/>
              &nbsp;</td>
            <td bgcolor="#CCCCCC">
     <bean:write name="findalltrainhead" property="headerTypeName"/>
              &nbsp;</td>
            <td height="31" bgcolor="#CCCCCC"> 
    <bean:write name="findalltrainhead" property="telNum"/>
              &nbsp;</td>
          </tr>
          </logic:iterate>再Action中的execute方法中
    你要这样写
    request.setAttribute("findalltrainheadresult",arrayList);如果有什么问题
    随时探讨
      

  8.   

    你应该在Form中定一个数组或HashMap之类的集合。然后再用iterate,iterate 是需要一个collction的数据结构的。
    你单独指定form就会出错。
      

  9.   

    坚决同意 qjhaaaaa 的观点!