Using predefined column lists

This example shows how a predefined set of columns can be applied to a table.

All you have to do is feeding the table with a list of beans/Maps which contains the needed column attributes and create the needed <display:column> tags and use a simple iteration directly in the jsp

In this page we create three different set of colums, implemented as Lists of Maps, directly in the jsp. Obviously, you will probably want to configure them in a db, xml file, or any other source for a real use (Spring xml files could be an easy and flexible solution). No dipendence on displaytag-specific classes is required in your application, since you can simply use a plain Map or implement a custom bean.

Click on a column set below to see it applied to the table.





email title date money
gubergren-sadipscing@sed.com Tue Feb 16 22:34:28 CET 2010 3137.00 €
aliquyam-nonumy@et.com Sun Jun 13 22:34:28 CEST 2010 555.00 €
et-est@voluptua.com Mon Dec 21 22:34:28 CET 2009 5413.00 €
amet-accusam@ipsum.com Tue Jul 20 22:34:28 CEST 2010 8297.00 €
takimata-erat@rebum.com Mon Feb 16 22:34:28 CET 2009 7163.00 €
eos-et@sed.com Sat Aug 15 22:34:28 CEST 2009 1308.00 €
duo-et@dolores.com Sun Feb 08 22:34:28 CET 2009 5728.00 €
ipsum-vero@invidunt.com Sun Mar 07 22:34:28 CET 2010 1705.00 €
clita-nonumy@ipsum.com Sat Oct 16 22:34:28 CEST 2010 8974.00 €
eos-gubergren@eirmod.com Fri Sep 10 22:34:28 CEST 2010 2297.00 €