list集合存list 以及s标签在foreach循环遍历中用EL表达式取值

特点总结:
在一个iterator集合容器中遍历另外一个list中的list的,通过iterator中的 status="status"状态为,同时	<a href="<s:url action="fileformAction_download"/>?fileid=${bean.fileid}">${bean.filename}</a>
解决了s标签中无法用EL表达式取值的难题。

controller中的代码:
List<List<Fileform>> fileformlilist=new ArrayList<List<Fileform>>();
		for(int i=0;i<projectlist.size();i++){
			List<Fileform> filelist=fileformService.ByOtherId(projectlist.get(i).getProjectid());
			fileformlilist.add(i, filelist);
		}
		ActionContext.getContext().put("fileformlilist", fileformlilist);

jsp中的代码:
<tbody id="TableData" class="dataContainer" datakey="projectList">
				<s:iterator value="#getProjectpage" status="status">
					<tr class="TableDetail1 template">
						<td align="center">${status.index + 1} </td>
						<td align="center">${projectname} </td>
						<td align="center">${employeename} </td>
						<td align="center">
						<c:forEach items="${fileformlilist.get(status.index)}" var="bean">
								<a href="<s:url action="fileformAction_download"/>?fileid=${bean.fileid}">${bean.filename}</a>
								</c:forEach></td>
						<td align="center">
						<s:a action="projectAction_infoUI?projectid=%{projectid}">查看</s:a> 
						<s:a action="projectAction_editUI?projectid=%{projectid}">修改</s:a> 
						<s:a action="projectAction_delete?projectid=%{projectid}" οnclick="return window.confirm('这将删除本条宿舍信息,你确定要删除吗?')">删除</s:a>
						</td>
					</tr>
				</s:iterator>
			</tbody></span>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值