遇到这样一个问题 郁闷半天也没找到解决方法 有谁能帮帮我呀?使用jstl显示一个表 表格第一列放的是记录号,但是记录号是自己写的,不是从数据库里读出来的,问题是怎么显示那一列记录号
<table>
<c:forEach items="${logList}" var="logDto" step="1">
<tr height=30 align="left">
<td nowrap width="60">1</td>
<td nowrap width="160"><my:sf fd="${logDto.searchTime}"/></td>
<td nowrap width="60"><my:sf fd="${logDto.userNo}"/></td>
<td nowrap width="60"><my:sf fd="${logDto.clientCode}"/></td>
<td nowrap width="160">(<my:substr end="9" start="0" str="${logDto.txDateStr}"/> , <my:substr end="9" start="0" str="${logDto.txDateEnd}"/>)</td>
<td nowrap width="100"><my:sf fd="${logDto.searchDesc}"/></td>
<td nowrap width="400"><my:sf fd="${logDto.searCon}"/></td>
</tr>
</c:forEach>
</table>
<td nowrap width="60">1</td> 这一列显示的是记录号
可以使用这个方法建一列
<table border="1" align="center">
<tr><td>A</td><td>B</td></tr>
<c:forEach var="i" begin="0" end="5">
<tr>
<td><c:out value="${i}"/></td>
</tr>
</c:forEach>
</table>关键我怎么把这两个for:each放到一起呀
<table>
<c:forEach items="${logList}" var="logDto" step="1">
<tr height=30 align="left">
<td nowrap width="60">1</td>
<td nowrap width="160"><my:sf fd="${logDto.searchTime}"/></td>
<td nowrap width="60"><my:sf fd="${logDto.userNo}"/></td>
<td nowrap width="60"><my:sf fd="${logDto.clientCode}"/></td>
<td nowrap width="160">(<my:substr end="9" start="0" str="${logDto.txDateStr}"/> , <my:substr end="9" start="0" str="${logDto.txDateEnd}"/>)</td>
<td nowrap width="100"><my:sf fd="${logDto.searchDesc}"/></td>
<td nowrap width="400"><my:sf fd="${logDto.searCon}"/></td>
</tr>
</c:forEach>
</table>
<td nowrap width="60">1</td> 这一列显示的是记录号
可以使用这个方法建一列
<table border="1" align="center">
<tr><td>A</td><td>B</td></tr>
<c:forEach var="i" begin="0" end="5">
<tr>
<td><c:out value="${i}"/></td>
</tr>
</c:forEach>
</table>关键我怎么把这两个for:each放到一起呀
<c:forEach items="${XXX}" var="item" varStatus="tag">
"${tag.count}"
</c:forEach>
<c:forEach items="${logList}" var="logDto" step="1" varStatus="status">
<tr height=30 align="left">
<td nowrap width="60"><c:out value="${status.count}"/></td>......
特性 Getter 描述
count getCount() 当前这次迭代从 1 开始的迭代计数
--------------我也是刚学.你都会自定义的tag了,基础的就不用了?
我又遇到一个问题 谁能帮我看看 谢谢各位了 ^_^自定义一个标签<my:test value="${tmp}" var="xx"/>
我要把value中的值存放在var属性值xx中,可以使用<c:out value="${xx}"/>将xx中存放的value的值$tmp读出来 我该怎么做呀 ? 谢谢