<logic:iterate id="row1" name="rows"> 
name处应是一个集合在request或session中的名称,您应该在这个jsp页面的上一级action中定义一个集合,然后把集合存放到request或session,然后转向到这个jsp页面

解决方案 »

  1.   

    <logic:iterate id ="" name ="">
    name应该是一个集合request或session中的的名称,id可以自己随便定义。
    我给你个例子:
    下面显示的是logic:iterate这个标签
     <logic:iterate id="findalltrainhead"  name="findalltrainheadresult" >
          <tr>
            <td nowrap bgcolor="#CCCCCC"> <input  id="trainHeadID" type="checkbox" name="checkbox" value="<bean:write  name="findalltrainhead" property="trainHeaderID"/> "> </td>
            <td height="31" nowrap bgcolor="#CCCCCC">
         <!--&frac12;&acirc;&frac34;&ouml;·&frac12;·¨1
                    <a  href="../trainhead/trainHead.do?operate=findtoupdateTrainHead&trainHeaderID=<bean:write  name="findalltrainhead" property="trainHeaderID"/>"><bean:write name="findalltrainhead" property="trainHeaderCode"/>
    </a>-->
              <!--&frac12;&acirc;&frac34;&ouml;·&frac12;·¨2-->
    <a  href="../trainhead/trainHead.do?operate=findtoupdateTrainHead&trainHeaderID=<bean:write  name="findalltrainhead" property="trainHeaderID"/>&trainHeaderCode=<bean:write name="findalltrainhead" property="trainHeaderCode"/>&deptID=<bean:write name="findalltrainhead" property="deptID"/>&deptName=<bean:write name="findalltrainhead" property="deptName"/>&headTypeID=<bean:write name="findalltrainhead" property="headTypeID"/>&headerTypeName=<bean:write name="findalltrainhead" property="headerTypeName"/>&telNum=<bean:write name="findalltrainhead" property="telNum"/>"><bean:write name="findalltrainhead" property="trainHeaderCode"/>
    </a>
              &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>
    下面是我在execute方法中写的
      if(!v.isEmpty())
                {
                    LoginActionForm loginActionForm  = new LoginActionForm();
                    httpServletRequest.setAttribute("userName",loginActionForm.getUserName());
                    //&Iuml;&Ocirc;&Ecirc;&frac34;&Euml;ù&Ecirc;&ocirc;&raquo;ú&Icirc;&ntilde;&para;&Icirc;&Atilde;&ucirc;&sup3;&AElig;
                    Vector DeptName = new Vector ();
                    DeptName = showDeptName();
                    httpServletRequest.setAttribute("deptNameShow",DeptName);
                    //&Iuml;&Ocirc;&Ecirc;&frac34;&sup3;&micro;&Iacute;·&Agrave;à&ETH;&Iacute;&Atilde;&ucirc;&sup3;&AElig;
                    Vector HeaderTypeName = new Vector();
                    HeaderTypeName=  showHeaderTypeName();
                    httpServletRequest.setAttribute("headerTypeNameShow",HeaderTypeName);
                    trainHeadForm.setDeptName(trainHeadForm.getDeptName());
                    trainHeadForm.setHeaderTypeName(trainHeadForm.getHeaderTypeName());
                     trainHeadForm.setTrainHeaderCode(Function.toChinese(trainHeadForm.getTrainHeaderCode()));
                    //&Iuml;&Ocirc;&Ecirc;&frac34;&Euml;ù&Oacute;&ETH;&micro;&Auml;&sup3;&micro;&Iacute;·&ETH;&Aring;&Iuml;&cent;
                     httpServletRequest.setAttribute("findalltrainheadresult", v);
                    //&Egrave;&ccedil;&sup1;&ucirc;&sup3;&micro;&Iacute;·&ETH;&Aring;&Iuml;&cent;±í&sup2;&raquo;&Icirc;&ordf;&iquest;&Otilde;×&ordf;&Iuml;òtrainHeadMain.jsp&pound;&not;&Iuml;&Ocirc;&Ecirc;&frac34;&Euml;ù&Oacute;&ETH;&Ecirc;&yacute;&frac34;&Yacute;
                     return (actionMapping.findForward("findall_trainhead_result"));
                }
                else
                {
                     //&Iuml;&Ocirc;&Ecirc;&frac34;&Icirc;&THORN;&sup2;é&Ntilde;&macr;&frac12;á&sup1;&ucirc;&micro;&Auml;&frac14;&Ccedil;&Acirc;&frac14;&ETH;&Aring;&Iuml;&cent;
                     ActionErrors errors = new ActionErrors();
                     ActionError error =  new ActionError("trainhead.findalltrainhead.noresult");
                     errors.add(ActionErrors.GLOBAL_ERROR,error);
                     saveErrors(httpServletRequest,errors);
                     Vector DeptName = new Vector ();
                     //&Iuml;&Ocirc;&Ecirc;&frac34;&Euml;ù&Ecirc;&ocirc;&raquo;ú&Icirc;&ntilde;&para;&Icirc;&Atilde;&ucirc;&sup3;&AElig;
                     DeptName = showDeptName();
                     httpServletRequest.setAttribute("deptNameShow",DeptName);
                     //&Iuml;&Ocirc;&Ecirc;&frac34;&sup3;&micro;&Iacute;·&Agrave;à&ETH;&Iacute;&Atilde;&ucirc;&sup3;&AElig;
                     Vector HeaderTypeName = new Vector();
                     HeaderTypeName=  showHeaderTypeName();
                     httpServletRequest.setAttribute("headerTypeNameShow",HeaderTypeName);
                     trainHeadForm.setDeptName(trainHeadForm.getDeptName());
                     trainHeadForm.setHeaderTypeName(trainHeadForm.getHeaderTypeName());
                     trainHeadForm.setTrainHeaderCode(Function.toChinese(trainHeadForm.getTrainHeaderCode()));                 //±í&Ecirc;&frac34;&Atilde;&raquo;&Oacute;&ETH;·&ucirc;&ordm;&Iuml;&Igrave;&otilde;&frac14;&thorn;&micro;&Auml;&sup2;é&Ntilde;&macr;&frac14;&Ccedil;&Acirc;&frac14;
                     httpServletRequest.setAttribute("findalltrainheadresult", trainHeadList);
                     //&Egrave;&ccedil;&sup1;&ucirc;&sup3;&micro;&Iacute;·&ETH;&Aring;&Iuml;&cent;±í&Icirc;&ordf;&iquest;&Otilde;×&ordf;&Iuml;òtrainHeadMain.jsp
                     return (actionMapping.findForward("findall_trainhead_noresult"));
                }
              }catch(Exception ex)
              {
               //throw ex;
                   ActionErrors errors = new ActionErrors();
                   ActionError error =  new ActionError("trainhead.findalltrainhead.noresult");
                   errors.add(ActionErrors.GLOBAL_ERROR,error);
                   saveErrors(httpServletRequest,errors);
                   return (actionMapping.findForward("findall_trainhead_noresult"));
            }
       }
    呵呵,我开始也是遇到你这样的问题,后来自己解决了,很麻烦的
    最好你们项目组的有个人会,不会就麻烦了,一个人做要走很多弯路的
      

  2.   

    Cannot find bean guide in any scope
    没有找到bean。
      

  3.   

    guide 是什么东西?你的form么?
    <logic:iterate>中name是指你所要使用的beanForm的名字。你那个rows是个form么?我觉得rows应该是property属性啊
      

  4.   

    <logic:iterate id="aa" name="guide"> 
    <tr> 
    <td> 
    <bean:write name="aa" property="USER_NAME"/> 
    </td> 
    </tr> 
    </logic:iterate> 
    应该是这样,guide是我在ACTION中定义的:request.setAttribute("guide","ggggg");
      

  5.   

    写成这样试试
    <logic:iterate id="aa" name="guide" scope = "request">
      

  6.   

    另外,你的"ggggg"是个什么东西,要想用<bean:write>显示里面的东西,"ggggg"就应该是个bean才行,而且里面要定义"USER_NAME"的get和set方法.
      

  7.   

    ggggg就是ACTION中静态的变量啊,相当于我把ggggg要传到JSP页面,在JSP页面接收,应该可以吧,另外你说的方法我试过了,如果scope = "request"不写,默认从页到整个应用进行搜索,总之,写不写都不对,报错,我是没办法了?
      

  8.   

    看看这样:
    GUIDE名字和定义的FORMBEAN名字对应起来,另外你的property="USER_NAME"是否存在,在STRUTS-CONFIG文件中ACTION定义是否为APPLICATION
      

  9.   

    看看这样:
    GUIDE名字和定义的FORMBEAN名字对应起来,另外你的property="USER_NAME"是否存在,在STRUTS-CONFIG文件中ACTION定义是否为APPLICATION
      

  10.   

    这个错误的原因可能是:你在<logic:iterate id="aa" name="guide"〉...</logic:iterate>中间嵌套了<tr><td>这类属于<table>标签的子标签,也就是说你的标签嵌套有问题,
    这样试试看:
    <tr><td>
    <logic:iterate id="row1" name="rows">
    <table>
    <tr> 
    <td> 
    <bean:write name="row1" property="USER_NAME"/> 
    </td> 
    </tr>
    </table> 
    </logic:iterate>
    </td></tr> 
    在<logic:iterate>...</logic:iterate> 之间直接嵌套<table>...</table>