社区
Web 开发
帖子详情
用怎么控制循环?
frank1197
2008-07-29 12:00:47
在画面初期化的时候,页面就想显示固定的20条记录,用这个标签能不能实现...
<%
for(int i = 0;i<20;i++) {
%>
<tr>fafafa</tr>
<% } %>
就是想用<logic:iterate>标签代替上面的代码.....
...全文
441
9
打赏
收藏
用怎么控制循环?
在画面初期化的时候,页面就想显示固定的20条记录,用这个标签能不能实现... <% for(int i = 0;i fafafa 就是想用标签代替上面的代码.....
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
9 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
jyq0105
2008-07-29
打赏
举报
回复
那你就给这固定的20条数据不就得了啊
lyric1812
2008-07-29
打赏
举报
回复
<logic:notEmpty name="lstPaper" scope="request">
<logic:iterate id="paperManage" name="lstPaper" type="cn.ujn.lunwen.manager.PaperManage" scope="request">
<tr>
<td>
<bean:write name="paperManage" property="lwzwmc" scope="page"/>
</td>
<td>
<bean:write name="paperManage" property="kwmc" scope="page"/>
</td>
<td align="center">
<bean:write name="paperManage" property="fbrq" scope="page"/>
</td>
<td align="center">
院[<bean:write name="paperManage" property="checka" scope="page"/>]
校[<bean:write name="paperManage" property="checkb" scope="page"/>]
</td>
<td>
[<a href="/lunwen/paperMng.do?method=goModifyPaperPage&PaperNo=${paperManage.lwbh}&UserId=${rybh}" target="mainFrame">修改</a>]
[<a href="/lunwen/paperMng.do?method=goDeletePaperPage&PaperNo=${paperManage.lwbh}&UserId=${rybh}" target="mainFrame">删除</a>]
</td>
</tr>
</logic:iterate>
</logic:notEmpty>
hx2044
2008-07-29
打赏
举报
回复
[Quote=引用 7 楼 zhangjg2124 的回复:]
加这两个属性:length="20" offset="0" offset是设置开始的位置(“0”表示第一条),你也可以设置成其他地方开始
[/Quote]
zhangjg2124
2008-07-29
打赏
举报
回复
加这两个属性:length="20" offset="0" offset是设置开始的位置(“0”表示第一条),你也可以设置成其他地方开始
hanyu51766
2008-07-29
打赏
举报
回复
用logic:iterate 里的 length offset属性来实现
skylovehang
2008-07-29
打赏
举报
回复
给你看个实例,自己钻研下
<logic:notEmpty name="OutListForm" property="list">
<logic:iterate name="OutListForm" property="list" id="vo"
type="com.neusoft.wms.outwarehouse.outlist.form.OutListMovementForm">
<%index++; %>
<tr>
<td nowrap=true class=singleDetailData width="25">
<input type="checkbox" name='chk'
value='<bean:write name="vo" property="rowId"/>'
id='<bean:write name="vo" property="rowId"/>' />
</td>
<td nowrap=true class=singleDetailData width="">
<bean:write name="vo" property="billNo" />
</td>
<td nowrap=true class=singleDetailData width="">
<bean:write name="vo" property="originNo" />
</td>
<td nowrap=true class=singleDetailData width="">
<bean:write name="vo" property="businessDate" />
</td>
<td nowrap=true class=singleDetailData width="">
<bean:write name="vo" property="lovName" />
</td>
<td nowrap=true class=singleDetailData width="">
<input type="hidden" name="mainstatus[<%=index%>]" id="mainstatus[<%=index%>]" value='<bean:write name="vo" property="status" />'/>
<span id="status[<%=index%>]"></span>
<script language="javascript">
<!--
var status = '<bean:write name="vo" property="status" />';
var transferstatus =( status == '0' ? "初始" :
(status == '1' ? "已下架":"已记账"));
document.getElementById("status[<%=index%>]").innerHTML=transferstatus;
-->
</script>
</td>
<td nowrap=true class=singleDetailData width="" align="right">
<bean:write name="vo" property="totalQty"/>
</td>
</tr>
</logic:iterate>
</logic:notEmpty>
估计你看的懂
Tongates
2008-07-29
打赏
举报
回复
<logic:iterate id="aList" name="YourForm" property="YourDataList" indexId="indexId" length="20" offset="0">
offset指定从list的那个元素开始,length指定从list中取得多少个元素
phon_oy
2008-07-29
打赏
举报
回复
<%
Vector animals = new Vector();
animals.addElement("Dog");
animals.addElement("Cat");
animals.addElement("Bird");
animals.addElement("Chick");
request.setAttribute("Animals", animals);
%>
<logic:iterate id="element" name="Animals">
<bean:write name="element"/><br>
</logic:iterate>
关于<
logic
:
iterate
>用法
本文详细介绍了如何在Struts框架中使用<
logic
:
iterate
>标签实现数据的分列显示,并提供了在结合使用Hibernate进行文件上传与下载操作时解决HQL执行问题的方法。此外,还探讨了如何遍历不同类型的集合对象,如Vector和HashMap,并展示了如何通过JavaBean读取数据库中的数据。
struts标签
logic
:
iterate
学习
本文详细介绍了Struts框架中的逻辑标记库<
logic
:
iterate
>的使用方法及示例,展示了如何通过该标记
循环
遍历不同类型的集合,并
控制
循环
的起始位置和长度。
struts1吊牌<
logic
:
iterate
>
本文详细介绍了Struts框架中<
logic
:
iterate
>标签的使用方法,包括如何遍历数组、Collection、Map等集合对象,并提供了具体的示例代码,演示了如何使用id、name、type属性以及嵌套遍历、输出元素数量
控制
等功能。
struts
Logic
标签
本文介绍了Struts
Logic
标签库中的关键标签,包括用于比较运算、字符串匹配、判断内容存在与否及
循环
遍历等标签,并解释了它们如何帮助
控制
页面输出。
传智播客 struts1.x 常用标签的使用
本文详细介绍了Struts框架中的国际化标签<bean:message>的使用方法,包括资源文件配置、多语言支持等,并深入探讨了逻辑标签库中的<
logic
:
iterate
>标签的应用,展示了如何在JSP页面中实现
循环
输出。
Web 开发
81,111
社区成员
341,723
社区内容
发帖
与我相关
我的任务
Web 开发
Java Web 开发
复制链接
扫一扫
分享
社区描述
Java Web 开发
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章