Struts中用bean:size/bean:write来显示查询结果集合之总记录数

2019-02-28 14:39:13 浏览数 (1)

阅读更多

Struts中用bean:size/bean:write来显示查询结果集合之总记录数

并使用Struts的logic标签,遍历List时使用indeId来自动输出序号并加一 例子如下:

<logic:present name="targetbean"> <bean:size id="sizeOfThis" scope='request' name="targetbean" /> <p align="center">查询结果共有 <bean:write name='sizeOfThis' /> 条</p> <table> <tr> <td>序号</td> <td>姓名</td> ... </tr> <logic:present name="targetbean"> <logic:iterate name='helperbean' id='helperbean' type='net.echochina.HelperBean' scope='request' indexId="index"> <tr> <td><%= index.intValue() 1 %></td> <td><bean:write name='helperbean' property='name' /></td> ..... </tr> </logic:iterate> </logic:present> </table> </logic:present>

0 人点赞