servlet中的list for each entry用c:foreach中的items${list for each entry}取值无反应?

10 篇文章 0 订阅订阅专栏特点总结:
在一个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>
}

我要回帖

更多关于 list for each entry 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信