struts的标签非常的垃圾,你最好用jstl,你如果用了jstl并且会用了你绝对不会再用struts的标签了! jstl简单功能强大是超级好的东西!

解决方案 »

  1.   

    楼主写的比较复杂。看看我原来写的一个:
    -------------------
     <html:select property="doc">
          <html:option value="">--------不用模版--------</html:option>
          <logic:iterate id="Doctem" name="temList" type="ActionForms.DocumentList_ActionForm" scope="request">
            <logic:equal name="Doctem" property="fileType" value=".doc">
              <html:option value="${Doctem.recordID}">${Doctem.descript}</html:option>
            </logic:equal>
          </logic:iterate>
        </html:select>
    -------------------
    temList是一个Collection
      

  2.   

    struts不能标签嵌套
    可以这样吧,在jsp页面里写java语句:
    <logic:iterate id="row1" name="list1">  
    <logic:iterate id="row" name="list"> 
    <bean:define id="gameid"  name="row1" property="gameid">
    <option value="<bean:write name="row" property="gameid"/>" 
    <logic:equal name="row" property="gameid" value="<%=gameid>">selected</logic:equal>><bean:write name="row" property="gameName"/></option>  
            </logic:iterate></logic:iterate>
      

  3.   

    但是系统报错,
          <logic:iterate id="row" name="list"> 
          <bean:define id="gameid"  name="row1" property="gameid">
                    <option value="<bean:write name="row" property="gameid"/>"
                     <logic:equal name="row" property="gameid" value="<%=gameid%>">selected</logic:equal>>
                     <bean:write name="row" property="gameName"/></option>  
            </logic:iterate>
    我感觉是不是gameid这个变量系统不认识呀
      

  4.   

    但不知道怎样能解决那,<bean:define id="gameid"  name="row1" property="gameid">就是从list中取变量呀,
      

  5.   

    <%=gameid%>这样是输出不了gameid变量的。你看了我的代码吗?
    用${row.gameid}这种方式输出。
      

  6.   


    如果是这样呢
    <html:img page="/a.gif" alt="<bean:message key="label.update">"/>
    这样的嵌套 怎么解决呢
      

  7.   

    我非常感谢“nccxl(小猪的狗熊) ”和“madgirl() ”的方法,我的代码没有问题了,现在开始要学el了
      

  8.   

    ${row.gameid}是struts的语法 还是jsp的语法  在哪里可以查看相关的技术文档呢 谢了
      

  9.   

    其实我自己感觉页面上的东西到不是很主要的,能够实现显示就够了,用一句<%%>表示的用一堆<logic:...>而且事实上页面上写java也不会影响什么美工对页面的操作当然jstl还是挺好用的
      

  10.   

    ?  ${row.gameid}是struts的语法 还是jsp的语法 在哪里可以查看相关的技术文档呢是JSTL的语法,现在的struts也可以支持。楼主的问题应该是双引号没有正确的使用引用的
    把<option value="<bean:write name="row" property="gameid"/>"改成
    <option value="<bean:write name='row' property='gameid'/>"试试。