Display *: Tag Library
Tag table


Displays a list in an html table, formatting each item in the list according to the Column tags nested inside of this tag. Use the list attribute to indicate the Collection of data, in some scope, that the tag should operate on. Supports the export of the list data to alternative formats such as CSV, Excel, and XML. The contents of the list can be sorted, and the list can be broken into individual pages for display. If you use this tag in Struts, or in some other framework where the page is included via a jsp:include, you should use the requestURI attribute to indicate where tag generated links should point.

Example:
<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>


Tag Information
Tag Classorg.displaytag.tags.TableTag
TagExtraInfo Classorg.displaytag.tags.TableTagExtraInfo
Body ContentJSP
Display Nametable

Attributes
NameRequiredRequest-timeTypeDescription
listfalsetruejava.lang.StringReference to the object used as source for the table. Can be an expression like requestScope.object.property . You must define either the name attribute or the list attribute. Using "Name" is suggested.
namefalsetruejava.lang.Stringreference to the object used as source for the table. Can be an expression like requestScope.object.property. In the EL version of the taglibrary this must be an EL expression which points to the source object.
lengthfalsetrueintnumber of records to be shown
offsetfalsetrueintindex of the first record to be shown
pagesizefalsetrueintnumber of records in a page
decoratorfalsetruejava.lang.StringFully qualified class name for a TableDecorator. Use a TableDecorator to provide custom operations against the whole list, such as computing totals. Must extend org.displaytag.decorator.TableDecorator.
requestURIfalsetruejava.lang.StringWhen the present, links for sorting, exports, and paging are formed by adding any tag generated parameters to the value of requestURI attribute.
requestURIcontextfalsetruebooleanEnable/disable prepending of application context to generated links. Default is true, you can set it to false in order to generate cross-context links.
excludedParamsfalsetruejava.lang.StringWhitespace separated list containg the name of parameters which should NOT be forwarded during paging or sorting. You can use excludedParams="*" to match (exclude) any parameter.
varTotalsfalsetruejava.lang.StringStore a java.util.Map of the column totals in a pageContext variable by this name. The keys of the map are "column" and the column number (first column is "column1", etc); values are the corresponding total for the column; columns that are not marked as to total="true" will be omitted from the map. The variable will ONLY be available within the footer tag and after the end of the table, it is not available with the body of the table or columns.
stylefalsetruejava.lang.Stringhtml pass through attribute
classfalsetruejava.lang.Stringhtml pass through attribute
cellspacingfalsetruejava.lang.Stringhtml pass through attribute
cellpaddingfalsetruejava.lang.Stringhtml pass through attribute. Better using "padding" css attribute in style or class
framefalsetruejava.lang.Stringhtml pass through attribute.
rulesfalsetruejava.lang.Stringhtml pass through attribute.
summaryfalsetruejava.lang.Stringhtml pass through attribute
htmlIdfalsetruejava.lang.Stringhtml "id" pass through attribute
exportfalsetruebooleanenable/disable export. Valid values are true or false
idfalsetruejava.lang.StringSee "uid". The id attribute can't be a runtime expression in jsp 1.0 compliant containers, while uid will allow it.
uidfalsetruejava.lang.StringUnique id used to identify this table. The object representing the current row is also added to the pageContext under this name and the current row number is added using the key uid_rowNum. Two tables in the same page can't have the same uid (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.
sortfalsetruejava.lang.StringUse 'page' if you want to sort only visible records, or 'list' if you want to sort the full list, or 'external' if the data is sorted outside displaytag.
defaultsortfalsetrueintThe index of the column that will be used by default for sorting (starting from 1)
defaultorderfalsetruejava.lang.StringThe default order for the sorted column. Valid values are "ascending" (default) or "descending"
partialListfalsetruebooleanenable/disable partialLists. Valid values are true or false
sizefalsetruejava.lang.StringUsed only when partialList=true. Reference to the Integer object containing the size of the total dataset. Can be an expression like requestScope.object.property. In the EL version of the taglibrary this must be an EL expression which points to the source object.

Variables
No Variables Defined.


Output Generated by Tag Library Documentation Generator. Java, JSP, and JavaServer Pages are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries. Copyright 2002-4 Sun Microsystems, Inc. 4150 Network Circle Santa Clara, CA 95054, U.S.A. All Rights Reserved.