<display:table name="allNewsList" cellspacing="0" cellpadding="0" pagesize="20">
<!--这里如何产生一列checkbox-->
<!--这里如何产生行号:1,2,3...?-->
<display:column property="title" title="标题" url="/detail.jsp" paramId="id" paramProperty="id"/>
<display:column property="pubdate" title="发布日期" format="{0,date,yyyy-MM-dd HH:mm:ss}"/>
<display:column property="catalog_id" title="类别"/>
</display:table>
<!--这里如何产生一列checkbox-->
<!--这里如何产生行号:1,2,3...?-->
<display:column property="title" title="标题" url="/detail.jsp" paramId="id" paramProperty="id"/>
<display:column property="pubdate" title="发布日期" format="{0,date,yyyy-MM-dd HH:mm:ss}"/>
<display:column property="catalog_id" title="类别"/>
</display:table>
解决方案 »
- jsp ajax servelet 结合使用问题
- input text为什么会自动清除value
- EL表达式问题:javax.el.PropertyNotFoundException
- 使用IE8登录tomcat应用程序,如何才能保证每次session都是新创建的
- 请教一个用jstl表达的问题
- 20分求怎么让文本框只接受4个数字。
- 想在客户端页面控制扫描仪,并将图象上传到服务器,up有分。
- 为什么从属性文件读到的是乱码?
- Could not execute JDBC batch update 异常了 怎么调试?
- 有没做过 手机web银联支付接口的?
- 想做一个24点游戏,有什么算法吗?大家知道的和我说一下
- 严格的拼音排序法
我想你可以把行号放在一个属性中.
比如你的
News
{
title ;
pubdate ;
catalog_id ;
name ; //这个属性是我虚拟出来的,我想的News类中也该有没在页面上显示的某个字段吧
}
然后对allNewsList中的每个News的name设成 行号.
另外
下面是我在官网上找的例子,你试下:
uid ---- Unique id used to identify this table. The object representing the current row is also added to the pageContext under this name, so that you can refer to it in column bodies using ${uid}. You can also use uid_rowNum to refer to the current row number. Two tables in the same page can't have the same id (paging and sorting will affect both). If no "htmlId" is specified the same value will be used for the html id of the generated table. <display:table name="someList" export="true" id="row" requestURI="MyAction.do">
<display:column sortable="true" title="ID"> <c:out value="${row.id}"/> </display:column>
<display:column property="email" autolink="true"/>
<display:column property="description" title="Comments"/>
</display:table>
摘自:
http://displaytag.sourceforge.net/11/displaytag/tagreference.html我现在的项目有点乱,等有时间帮你试一下.
<display:column title="序号"><c:out value="${row_rowNum}"/></display:column>
楼上的谢谢,这样就行了!