关于logic:equal的问题 struts的标签非常的垃圾,你最好用jstl,你如果用了jstl并且会用了你绝对不会再用struts的标签了! jstl简单功能强大是超级好的东西! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 楼主写的比较复杂。看看我原来写的一个:------------------- <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 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> 但是系统报错, <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这个变量系统不认识呀 但不知道怎样能解决那,<bean:define id="gameid" name="row1" property="gameid">就是从list中取变量呀, <%=gameid%>这样是输出不了gameid变量的。你看了我的代码吗?用${row.gameid}这种方式输出。 如果是这样呢<html:img page="/a.gif" alt="<bean:message key="label.update">"/>这样的嵌套 怎么解决呢 我非常感谢“nccxl(小猪的狗熊) ”和“madgirl() ”的方法,我的代码没有问题了,现在开始要学el了 ${row.gameid}是struts的语法 还是jsp的语法 在哪里可以查看相关的技术文档呢 谢了 其实我自己感觉页面上的东西到不是很主要的,能够实现显示就够了,用一句<%%>表示的用一堆<logic:...>而且事实上页面上写java也不会影响什么美工对页面的操作当然jstl还是挺好用的 ? ${row.gameid}是struts的语法 还是jsp的语法 在哪里可以查看相关的技术文档呢是JSTL的语法,现在的struts也可以支持。楼主的问题应该是双引号没有正确的使用引用的把<option value="<bean:write name="row" property="gameid"/>"改成<option value="<bean:write name='row' property='gameid'/>"试试。 JSP中 乱码问题,求教 求教高手 struts2 问题 用checkbox实现对选中的条目进行删除的功能,请大家帮帮忙! 学习j2ee什么书比较好 apache的错误"信号灯超时时间已到"是何意思? 请问深圳好的人才网站有那些 散分100,STRUTS的问题! 连接MS SqlServer7的url怎样写?急 求好的j2ee书籍(纸版),来者有分 请问哪里可以找到ejb第二版的电子版下载? 初学EJB,求个EJB增删改查的例子源码学习,望有的扔一个,感谢大家 ORACLE 如何向ORACLE数据库插入DATE型数据
-------------------
<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
可以这样吧,在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>
<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这个变量系统不认识呀
用${row.gameid}这种方式输出。
如果是这样呢
<html:img page="/a.gif" alt="<bean:message key="label.update">"/>
这样的嵌套 怎么解决呢
把<option value="<bean:write name="row" property="gameid"/>"改成
<option value="<bean:write name='row' property='gameid'/>"试试。