DisplayTag的属性

<?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")</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>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值