`
huibin
  • 浏览: 750262 次
  • 性别: Icon_minigender_1
  • 来自: 郑州
社区版块
存档分类
最新评论

displaytag分页标签

阅读更多

http://displaytag.sourceforge.net/11/download.html

 

<?xml version="1.0" encoding="GBK"?>
<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
 "http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd ">
<taglib>
 <tlib-version>1.1</tlib-version>
 <jsp-version>1.2</jsp-version>
 <short-name>display</short-name>
 <uri>http://displaytag.sf.net </uri>
 <display-name>Display *: Tag Library</display-name>
 <description>
   The display tag library is an open source suite of custom tags that provide high level web presentation patterns
   which will work in a MVC model, and provide a significant amount of functionality while still being simple and
   straight-forward to use. The primary tag in the library is the Table tag.
 </description>
 <tag>
   <name>table</name>
   <tag-class>org.displaytag.tags.TableTag</tag-class>
   <tei-class>org.displaytag.tags.TableTagExtraInfo</tei-class>
   <body-content>JSP</body-content>
   <display-name>table</display-name>
   <description>
     在jsp中显示出一个表格,此表格可以通过定义属性来获得数据库中的表,可以分页排序的显示出来,还可以将表中的数据以
     CSV,Excel,和XML的格式生成。
   </description>
   <attribute>
     <name>list</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <description>
       参考表格中使用的源对象,可以表示一个请求对象范围的特性,你必须定义一个name属性或list属性,使用Name来暗示。
     </description>
   </attribute>
   <attribute>
     <name>name</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <description>
       指定范围属性的名称,在标准标签库中必须有一个name标签来指向源对象
(request.setAttribute("test", (java.util.List) sqldb.getData()) //@*name="test"),
sqldb.getData()是 在数据库中取出的所有记录
     </description>
   </attribute>
   <attribute>
     <name>length</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>int</type>
     <description>
     设置显示在表格中的记录数(//@*length="5")
     </description>
   </attribute>
   <attribute>
     <name>offset</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>int</type>
     <description>
     设置从用户输入的索引值,显示索引值后的所有记录(//@*offset="3")
     </description>
   </attribute>
   <attribute>
     <name>pagesize</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>int</type>
     <description>
     用户输入表格每页显示的记录数,使表中的纪录分页显示((//@*pagesize="6")
     </description>
   </attribute>
   <attribute>
     <name>decorator</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>java.lang.String</type>
     <description>
     使用装饰模式转换数据显示,用户可以自己写decorator。
     </description>
   </attribute>
   <attribute>
     <name>requestURI</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>java.lang.String</type>
     <description>
       在struts中,当设置了排序后,点击表头,它会指向你转向的jsp,如果想跳转到servlet,action,或者其他页面,
可 以通过requestURI设置跳转地址。
     </description>
   </attribute>
   <attribute>
     <name>style</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>java.lang.String</type>
     <description>HTML通用属性。</description>
   </attribute>
   <attribute>
     <name>class</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>java.lang.String</type>
     <description>
     为表格定义样式.这里有五种样式:isis,its,mars,simple,report,mark,但要引入screen.css样式表.
     </description>
   </attribute>
   <attribute>
     <name>cellspacing</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>java.lang.String</type>
     <description>HTML通用属性,表格中单元格的边距</description>
   </attribute>
   <attribute>
     <name>cellpadding</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>java.lang.String</type>
     <description>HTML通用属性,设置单元格沿四边的大小宽度,比在style或class中使用"padding"更 好.</description>
   </attribute>
   <attribute>
     <name>frame</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>java.lang.String</type>
     <description>HTML通用属性.</description>
   </attribute>
   <attribute>
     <name>rules</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>java.lang.String</type>
     <description>HTML通用属性.</description>
   </attribute>
   <attribute>
     <name>summary</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>java.lang.String</type>
     <description>HTML通用属性</description>
   </attribute>
   <attribute>
     <name>htmlId</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>java.lang.String</type>
     <description>html中"id"通用属性 </description>
   </attribute>
   <attribute>
     <name>export</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>boolean</type>
     <description>
     设置能否导出:Excel,XML,CSV文件,为true时可以导出. (//@*export="true")
     </description>
   </attribute>
   <attribute>
     <name>id</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>java.lang.String</type>
     <description>
       添加id属性,同时就在pageContext里创建了一个隐含对象,指向list里的当前对象可以通过
(ListObject)pageContext.getAttribute("id") 来捕获这个对象。同时还创建了一个id_rowNum对象,同样,可
       通过pageContext.getAttribute("testit_rowNum")来捕获,它仅仅代表当前行的行数。
     </description>
   </attribute>
   <attribute>
     <name>sort</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>java.lang.String</type>
     <description>
      输入'list'并在列属性中sortable为true的情况下,则按照表中所有记录进行排序(//@*sort="list").
     </description>
   </attribute>
   <attribute>
     <name>defaultsort</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>int</type>
     <description>
     按照索引列的序号进行排序(//@*defaultsort="1"表示第一列).
     </description>
   </attribute>
   <attribute>
     <name>defaultorder</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>java.lang.String</type>
     <description>
       对指定索引列的序号(defaultsort属性)进行"升序(ascending)"(默认)或"降序(descending)", (//@*defaultorder="descending")。
     </description>
   </attribute>
   <attribute>
     <name>partialList</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>boolean</type>
     <description>能否显示集合的一部分,有效的值是true或false(//@*partialList="true")& lt;/description>
   </attribute>
   <attribute>
     <name>size</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <description>
       当partialList为true时才能使用,是写入一个整型对象,它是包含总数据集大小的,要用方法给整数赋予属性
(request.setAttribute("sum",new Integer(count))),count是数据库中所有记录总数,sum是属性名,在size属性中
这样 写://@*size="sum".
     </description>
   </attribute>
   <example>
     <![CDATA[
<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>
]]>
   </example>
 </tag>
 <tag>
   <name>column</name>
   <tag-class>org.displaytag.tags.ColumnTag</tag-class>
   <body-content>JSP</body-content>
   <display-name>column</display-name>
   <description>
     在表格内显示一个烈的属性,必须在table标签内;其属性名决定决定显示列的内容,
     如果属性为空,则在jsp页面中没有显示。
   </description>
   <attribute>
     <name>property</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>java.lang.String</type>
     <description>
       此属性名是用来显示列中记录的,属性名是pojo类(bean类)中的属性。
(//@*property="job_id" job_id是pojo类中的一个属性)
     </description>
   </attribute>
   <attribute>
     <name>title</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>java.lang.String</type>
     <description>列中的标题,列头(//@*title="名称")</description>
   </attribute>
   <attribute>
     <name>comparator</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <description>
       The classname of comparator to use when sorting this column, or the comparator itself. Defaults to the
       DefaultComparator.
     </description>
   </attribute>
   <attribute>
     <name>total</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>boolean</type>
     <description>
      在table标签中添加 decorator="org.displaytag.decorator.TotalTableDecorator",
      然后在想要进行合计的数据列的 column标签中添加 //@*total="true",该列就可以被计算总数了。
     </description>
   </attribute>
   <attribute>
     <name>sortable</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>boolean</type>
     <description>此属性如果设置为真那么此列可以排序默认为假(//@*sortable="true").< /description>
   </attribute>
   <attribute>
     <name>defaultorder</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>java.lang.String</type>
     <description>
       默认为此列排序,有效值为升序(默认)和降序(//@*defaultorder="ascending" 或 //@*defaultorder="descending")
     </description>
   </attribute>
   <attribute>
     <name>autolink</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>boolean</type>
     <description>
       如果要显示的对象里包含email和url地址,则可以在display:column里直接设定autolink="true"来直接连接,默认为 false.
     </description>
   </attribute>
   <attribute>
     <name>format</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>java.lang.String</type>
     <description>
       可以使用标签的方式格式化时间、数字、字符串。比如日期,在需要格式化的column标签中添加
//@*format=" {0,date,yyyy-MM-dd}",第一个参数为格式化的数据序号,
第二个参数是数据类型,数字为number,第三个参数为数据格式。
     </description>
   </attribute>
   <attribute>
     <name>href</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>java.lang.String</type>
     <description>
       创建动态连接,基本的URL地址,等价于HTML中的href但不能传参。
     </description>
   </attribute>
   <attribute>
     <name>url</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>java.lang.String</type>
     <description>
       基于url的动态链接,等同于HTML中的href(//@*url="index.jsp").
     </description>
   </attribute>
   <attribute>
     <name>paramId</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>java.lang.String</type>
     <description>
       加在href属性的URL地址后的参数名称(//@*paramId="id" 等同于HTML中的 a href="index.jsp?id"的id参数)。
     </description>
   </attribute>
   <attribute>
     <name>paramName</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>java.lang.String</type>
     <description>
       加在href属性的URL地址后的参数值(//@*paramName="name" 等同于HTML中的 a href="index.jsp?id=name" id对应的name值)。
     </description>
   </attribute>
   <attribute>
     <name>paramProperty</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>java.lang.String</type>
     <description>
      数据bean的属性名称,用来填充href属性的URL地址后的参数值(//@*paramProperty="job_id" job_id是pojo类中的属性)
      display:column href="baseurl" paramId="paramid"  paramProperty="propertyname"
      http://baseurl/paramid= 名 字为propertyname的属性值。
     </description>
   </attribute>
   <attribute>
     <name>paramScope</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>java.lang.String</type>
     <description>
       设置paramid后边的的名称,此名称为范围内的名字为paramName的值,
(display:column href="baseurl" paramId="paramid"  paramName="name" paramScope="scope"
       写成HTML是:http://baseurl/paramid=scope )
     </description>
   </attribute>
   <attribute>
     <name>maxLength</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>int</type>
     <description>
       如果此属性存在,那么列的字符仅被显示用户定义的字符数,
然后加上。。。(//@*maxLength="10" 如果在备注这列加上其属性,那么备注的字段只显示10个字符和。。。)
当鼠标划过的时候显示其全部内容
     </description>
   </attribute>
   <attribute>
     <name>maxWords</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>int</type>
     <description>
       如果此属性存在,那么列仅被显示用户定义的单词数,然后加上。。。
(//@*maxWords="2" 如果在备注这列加上其属性,那么备注的字段只显示2个单词加。。。)
当鼠标划过的时候显示其全部内容
     </description>
   </attribute>
   <attribute>
     <name>class</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>java.lang.String</type>
     <description>
       HTML通用属性,设置列的样式。
     </description>
   </attribute>
   <attribute>
     <name>headerClass</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>java.lang.String</type>
     <description>"class"html中的属性仅能加在头单元格内</description>
   </attribute>
   <attribute>
     <name>style</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>java.lang.String</type>
     <description>HTML通用属性,设置列的样式。</description>
   </attribute>
   <attribute>
     <name>group</name>
     <required>false</required>
     <rtexprvalue>true</rtexprvalue>
     <type>int</type>
     <description>
       display:column property="city" title="CITY" group="1"
       display:column property="project" title="PROJECT" group="2"
       这样不仅仅结果可以分组,而且还可以省略掉重复的数据,例如city列,project列都有
       A ,B ,A,B 两行那么第二行这两列就不显示了。
       同样只能对当前页进行分组。
       注意:第一列一定要1,第二列一定是2,否则出NUllPoint 错误。
     </description>
   </attribute>
     </tag>
</taglib>

分享到:
评论

相关推荐

    displaytag 分页标签 中文化

    NULL 博文链接:https://wooden-baby.iteye.com/blog/494060

    Displaytag实现分页

    Displaytag 是一个开源的 Java 框架,用于在 Web 应用中生成表格和实现分页、排序等功能。它简化了在 JSP 页面中处理数据表的复杂性,提供了丰富的定制选项。以下是对 Displaytag 实现分页的详细解释: 1. **下载与...

    Struts2 DisplayTag 分页

    3. **创建JSP页面**:在JSP页面中引入DisplayTag的标签库,然后使用`&lt;display:table&gt;`标签来显示数据并实现分页。设置`id`属性用于引用Action中的数据,`export`属性可以控制是否导出数据,`pagesize`属性定义每页...

    displaytag 分页模版资料 JSP

    在提供的资料中,"displaytag分页模版使用说明书.xls"可能包含了一份详细的使用指南,涵盖如何配置DisplayTag,如何在JSP页面中嵌入标签,以及如何实现各种高级功能。这份文档将指导开发者了解DisplayTag的配置文件...

    displaytag分页jar包和使用说明

    DisplayTag是Java Web开发中的一款强大且功能丰富的表格和分页控件库,它极大地简化了在JSP页面中处理复杂表格和实现分页的工作。这个压缩包文件包含的就是DisplayTag的相关jar包以及可能的使用说明文档,对于开发...

    displaytag,pager-taglib 分页包

    Displaytag是一个开源的表格和分页显示标签库,它提供了许多高级特性,如排序、分页、导出、样式控制等。使用Displaytag,开发者可以快速地在网页上创建出功能丰富的表格,而无需编写大量的HTML和Java代码。以下是...

    DisplayTag分页

    DisplayTag分页技术的核心在于其能够自动处理大量数据,将这些数据按页显示,从而提高网页性能和用户体验。以下是关于DisplayTag分页的一些关键知识点: 1. **配置与引入**:首先,你需要在项目中引入DisplayTag库...

    一个完美的displaytag分页控件的例子

    这个"一个完美的displaytag分页控件的例子"显然展示了如何有效地利用DisplayTag库来实现一个美观且功能丰富的分页表格。 在JSP(JavaServer Pages)开发中,DisplayTag是一个常用的标签库,它提供了许多预定义的...

    displaytag 分页的简单例子(附源代码)

    - `displaytagexample.jsp`:包含DisplayTag的JSP示例代码,展示如何使用DisplayTag标签创建表格和分页。 - `DisplayTagExampleController.java`:控制器类,负责获取数据并设置模型属性。 - `User.java`:可能的...

    displaytag分页和鼠标经过变色功能

    Displaytag 是一个强大的开源Java库,用于创建复杂的HTML表格,包括分页、排序、过滤等功能。在Web开发中,为了提升用户体验,常常需要在表格中实现鼠标悬停时行变色的效果。由于Displaytag 默认并不支持这个功能,...

    displayTag 分页

    DisplayTag 是一个非常受欢迎的开源Java Web开发框架中的分页组件。它以其简洁的使用方式和强大的功能,被广泛应用于各种Web应用项目中,尤其是在处理大量数据展示时,能够有效地提高用户体验,减轻服务器压力。 ...

    displaytag-1.1.1标签库及其使用方法.rar

    DisplayTag 1.1.1是该库的一个版本,它包含了一系列预定义的JSP标签,使得创建复杂的、可分页、可排序、可导出的表格变得简单易行。在本篇中,我们将深入探讨DisplayTag 1.1.1的核心功能和使用方法。 首先,...

    displaytag 一个后台管理的分页组件

    然后,你可以在JSP页面中使用DisplayTag标签库,例如`&lt;display:table&gt;`,并指定数据源、属性、排序和分页参数。以下是一个简单的示例: ```jsp ``` 在上述代码中,`yourDataList`是你要显示的数据集合,`...

    DisplayTag标签使用说明

    DisplayTag 的主要目标是提高可读性、可维护性和可扩展性,同时提供丰富的功能,如排序、分页、国际化和自定义样式。 **1. 简单使用DisplayTag** DisplayTag 的基本用法是通过`&lt;display:table&gt;`标签来展示数据列表...

    displaytag jar包 ,一个在表现层分页的标签的jar包

    综上所述,DisplayTag是一个强大的表格和分页标签库,它简化了Web应用中的数据呈现,特别是在与Struts框架结合时,能极大地提高开发效率和用户体验。不过,为了保持系统安全和最佳性能,开发者应考虑适时升级到更...

    displaytag标签的使用

    DisplayTag 是一个强大的开源 JSP 标签库,专门用于处理网页中的表格展示。它提供了丰富的功能,如分页、数据导出、列排序和分组等,极大地简化了网页表格的开发工作。要使用 DisplayTag,首先需要从其官方网站...

    displaytag下拉框动态分页

    DisplayTag 是一个流行的 Java Web 应用程序标签库,它提供了一种简单的方式来处理表格数据的分页显示。本文将详细介绍如何使用 DisplayTag 实现下拉框动态分页功能,使得用户能够通过选择不同的选项来自定义每页...

Global site tag (gtag.js) - Google Analytics