list集合存list 以及s标签在foreach循环遍历中用EL表达式取值
生活随笔
收集整理的這篇文章主要介紹了
list集合存list 以及s标签在foreach循环遍历中用EL表达式取值
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
特點總結(jié):
在一個iterator集合容器中遍歷另外一個list中的list的,通過iterator中的 status="status"狀態(tài)為,同時 <a href="<s:url action="fileformAction_download"/>?fileid=${bean.fileid}">${bean.filename}</a>
解決了s標(biāo)簽中無法用EL表達(dá)式取值的難題。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>
總結(jié)
以上是生活随笔為你收集整理的list集合存list 以及s标签在foreach循环遍历中用EL表达式取值的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Android 封装标题栏
- 下一篇: 【游戏开发】按键精灵写《新天龙八部》脚本