1、打印迭代顺序 //${a.index+1 } 或 <s:property value="#a.count" /> 都能打印出迭代顺序 <s:iterator value="allltZhutiFiles" id="v" status="a"> <tr> <td class="edit_td_title">${a.index+1 } 楼:</td> <td colspan="5" class="edit_td_input"> ${v.fileTitle} </td> </tr> </s:iterator> 2、多层迭代 <!-- 两层迭代分别显示回复和回复附件 --> <s:iterator value="allltHuifuJbxxs" id="v" status="a"> <tr> <td valign="top" class="edit_td_title" width="12%"> ${a.index+1 } 楼: ${v.submitPersonName} </td> <td colspan="7" class="edit_td_input"> <!-- 回复类容 --> ${v.contentDesc} <br /> <!-- 判断是否存在附件 --> <s:if test="#v.ltHuifuFiles.size() > 0"> <font color="#0033FF">附 件:</font> <s:iterator value="#v.ltHuifuFiles" id="file"> <a href="${ctx}${file.fileAddr}" style="text-decoration: underline;" target="_blank">${file.fileTitle}</a> <br /> <br /> </s:iterator> </s:if> </td> </tr> </s:iterator 3、判断 //struts2标签判断:myZhuTie为Action中定义的属性 <s:if test="myZhuTie=='yes'"> <a href="#" class="btn_modify" onclick="updateZhuTi();"></a> <a href="#" class="btn_delete" id="delete" onclick="remove();"></a> </s:if> 4、格式化时间 <s:iterator value="dtjqlu.allJqfxJqglSp" status="st" id="sp"> <tr> <td class="edit_td_input_center"> <s:property value="#st.count" /> </td> <td class="edit_td_input_center"> ${sp.prvDeptName} </td> <td class="edit_td_input_center"> ${sp.prvPersonName} </td> <td class="edit_td_input_center"> ${sp.prvOpinion} </td> //格式化时间,submitTime 实体类属性 <td class="edit_td_input_center"> <s:date format="yyyy-MM-dd HH:mm" name="#sp.submitTime" /> </td> </tr> </s:iterator
struts2杂记-01
猜你喜欢
转载自x125858805.iteye.com/blog/1779273
今日推荐
周排行