Configuration

Configuration properties

This table lists all the configurable properties for the tag libraries. The default properties are defined in the displaytag.properties file included in the library jar.

There are 2 ways to override default property settings:

  • For the whole web application, create a custom properties file named displaytag.properties and place it in the application classpath (tipically into WEB-INF/classes). Displaytag will use the locale of the request object to determine the locale of the property file to use; if the key required does not exist in the specified file, the key will be loaded from a more general property file.
  • For a single table instance, using the <display:setProperty> tag

Include in your custom properties file only the properties you need to change. If a property is not defined in the user file, the default from the TableTag.properties included in the jar is used.

I18n

Some properties contain messages you may wish to display according to the user Locale. To do that first add a default displaytag.properties file where you set all the locale independent entries and default messages. Then you can add localized properties file (for example displaytag_IT.properties ).

Generic

PropertyDefaultValid ValuesDescriptionallowed in
properties
allowed in
setProperty
basic.show.headertruetrue, falseIndicates if you want the header to appear at the top of
the table, the header contains the column names, and any
additional action banners that might be required (like
paging, export, etc...)
yesyes
basic.empty.showtablefalsetrue, falseIndicates if you want the table to show up also if the list is
empty
yesyes
basic.msg.empty_listNothing found to displayany stringThe message that is displayed if the list that this table is
associated with is either null, or empty. Used only if
basic.empty.showtable is false
yesyes
basic.msg.empty_list_row<tr class="empty">
<td colspan="0">Nothing
found to display.</td>
</tr>
</tr>
Any stringThe message that is displayed into the first table row if the
list that this table is associated with is either null, or
empty. {0} is replaced with the total number of columns to
generate a correct colspan. Used only if
basic.empty.showtable is true
yesyes
sort.amountpagepage, listIndicates if the full list should be sorted before paging or
if the sorting only affects items in the current page.
Default behaviour is to sort only items in the current page
(first paging, then sorting)
yesno
export.banner<div class="exportlinks">
Export options: {0}
</div>
any stringContains the string that is displayed in the table footer when
the user indicates that they want to enable the export
function. The placeholder is replaced with links to the
various supported export formats
yesyes
export.banner.sepchar|any stringUsed to separate the valid export type (typically would be a
bar, a comma, or a dash)
yesyes
paging.banner.placementtoptop, bottom, bothWhen the table tag has to show the header for paging through
a long list, this option indicates where that header should be
shown in relation to the table
yesyes
paging.banner.item_nameitemany stringWhat the various objects in the list being displayed should be
referred to as (singular)
yesyes
paging.banner.items_nameitemsany stringWhat the various objects in the list being displayed should be
referred to as (plural)
yesyes
paging.banner.no_items_found<span class="pagebanner">
No {0} found.
</span>
any stringWhat is shown in the pagination header when no objects are
available in the list to be displayed. The single placeholder
is replaced with the name of the items in the list (plural)
yesyes
paging.banner.one_item_found<span class="pagebanner">
One {0} found.
</span>
any stringWhat is shown in the pagination header when one object is
available in the list to be displayed. The single placeholder
is replaced with the name of the items in the list (singular)
yesyes
paging.banner.all_items_found<span class="pagebanner">
{0} {1} found,
displaying all {2}.
</span>
any stringWhat is shown in the pagination header when all the objects in
the list are being shown. {0} and {2} are replaced with the
number of objects in the list, {1} is replaced with the name
of the items plural
yesyes
paging.banner.some_items_found<span class="pagebanner">
{0} {1} found,
displaying {2} to {3}.
</span>
any stringWhat is shown in the pagination header when a partial list of
the objects in the list are being shown.
Parameters:
* {0}: total number of objects in the list
* {1}: name of the items (plural)
* {2}: start index of the objects being shown
* {3}: end index of the objects being shown
* {4}: current page
* {5}: total number of pages
yesyes
paging.banner.group_size8any numberThe number of pages to show in the header that this person can
instantly jump to
yesyes
paging.banner.full<span class="pagelinks">
[<a href="{1}">First</a>
/<a href="{2}">Prev</a>]
{0}
[<a href="{3}">Next</a>
/<a href="{4}">Last</a>]
</span>
any stringWhat is shown in the pagination bar when there are more pages
and the selected page is not the first or the last one.
Parameters:
* {0}: numbered pages list
* {1}: link to the first page
* {2}: link to the previous page
* {3}: link to the next page
* {4}: link to the last page
* {5}: current page
* {6}: total number of pages
yesyes
paging.banner.first<span class="pagelinks">
[First/Prev] {0}
[<a href="{3}">Next</a>
/<a href="{4}">Last</a>]
</span>
any stringWhat is shown in the pagination bar when the first page is
being shown. Placeholders are the same as for
paging.banner.full
yesyes
paging.banner.last<span class="pagelinks">
[<a href="{1}">First</a>
/<a href="{2}">Prev</a>]
{0} [Next/Last]
</span>
any stringWhat is shown in the pagination bar when the last page is
being shown. Placeholders are the same as for
paging.banner.full
yesyes
paging.banner.onepage<span class="pagelinks">
{0}</span>
</span>
any stringWhat is shown in the pagination bar when only one page is
being shown. Placeholders are the same as for
paging.banner.full
yesyes
paging.banner.page.selected<strong>{0}</strong>any stringSelected page. {0} is replaced with the page number, {1}
with the page url.
yesyes
paging.banner.page.link<a href="{1}" title="Go to
page {0}">{0}</a>
any stringLink to a page. {0} is replaced with the page number, {1}
with the page url.
yesyes
paging.banner.page.separator,any stringseparator between pagesyesyes
decorator.media.htmlClass name of
TableDecorator
subclass
Decorator used to render table as html. Required when also
decorating the table in other media. Refer to the
exports decorators tutorial
for detailed explanation. Ignored if a decorator is
configured in table tag's decorator attribute.
yesyes
factory.requestHelperorg.displaytag.util.DefaultRequestHelperFactoryClass name for a valid
RequestHelperFactory
implementation
RequestHelperFactory to be used.
You can replace the default one if you need to generate links
with a different format (for example in portal applications)
yesno
factory.decoratororg.displaytag.decorator.DefaultDecoratorFactoryDecoratorFactory to be used.
Class name for a valid
DecoratorFactory
implementation
yes
You can replace the default one in order to load decorator
instances from different sources (e.g. you could use Spring
managed beans)
no
comparator.defaultorg.displaytag.model.DefaultComparatorDefault comparator to be used when sorting columns.
Class name for a valid
Comparator
implementation
yesyes

Exporting

Displaytag supports exporting to excel, csv, pdf, rtf, and xml formats. Some configurable properties are specific for one of these format.

Replace export name in the property name with "excel", "csv", "pdf", "rtf", or "xml". Some of the properties won't work in any export format.

PropertyDefaultValid ValuesDescriptionallowed in
properties
allowed in
setProperty
export.typescsv excel xml
pdf
any stringWhitespace separated list of configured export typesyesno
export.export nametruetrue, falseShould the tag present the option to export data in this
specific format
yesyes
export.export name.classAny valid class
that implements the
org.displaytag.export.ExportView interface
Fully qualified class name for the class which will be used
for exporting
yesno
export.export name.label<span class="export
export name">
export name </span>
Any stringThe label on the link that the user clicks on to export the
data in a specific format
yesyes
export.export name.include_headerfalsetrue, falseIf set to true, the first line of the export will contain
column titles as displayed on the HTML page.
yesyes
export.export name.filenamenoneany valid file nameWhen saving exported files the user will be prompted to use
this file name
yesyes
export.amountlistpage, listIndicates how much data should be sent down to the user when
they ask for a data export. By default, it sends the entire
list. You can instruct the table tag to only send down the
data that is currently being shown on the page
yesyes
export.decoratedtruetrue, falseShould the data be "decorated" as it is exported. Note that
org.displaytag.export.excel.DefaultHssfExportView,
org.displaytag.export.DefaultPdfExportView, and
org.displaytag.export.DefaultRtfExportView
do not observe this value.
yesyes
decorator.media.export nameClass name of
TableDecorator
subclass
Decorator used to render table in given media.
Refer to the exports and
decorators tutorial
for detailed explanation. Ignored if a
decorator is configured in table tag's decorator attribute.
yesyes

CSS

PropertyDefaultValid ValuesDescriptionallowed in
properties
allowed in
setProperty
css.tr.evenevenany valid css
class name
css class automatically added to even rowsyesyes
css.tr.oddoddany valid css
class name
css class automatically added to odd rowsyesyes
css.th.sortedsortedany valid css
class name
css class automatically added to the header of sorted columnsyesyes
css.th.ascendingorder1any valid css
class name
css class automatically added to the header of a column sorted
in ascending order
yesyes
css.th.descendingorder2any valid css
class name
css class automatically added to the header of a column sorted
in descending order
yesyes
css.tablenoneany valid css
class name
css class automatically added to the main table tagyesyes
css.th.sortablenoneany valid css
class name
css class automatically added to any sortable columnyesyes