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.





date date
Wed Sep 16 18:09:05 CEST 2009 Wed Sep 16 18:09:05 CEST 2009
Mon Jan 12 18:09:05 CET 2009 Mon Jan 12 18:09:05 CET 2009
Wed Jan 13 18:09:05 CET 2010 Wed Jan 13 18:09:05 CET 2010
Sun Aug 02 18:09:05 CEST 2009 Sun Aug 02 18:09:05 CEST 2009
Sun Sep 26 18:09:05 CEST 2010 Sun Sep 26 18:09:05 CEST 2010
Tue Nov 09 18:09:05 CET 2010 Tue Nov 09 18:09:05 CET 2010
Tue Jul 14 18:09:05 CEST 2009 Tue Jul 14 18:09:05 CEST 2009
Mon Mar 16 18:09:05 CET 2009 Mon Mar 16 18:09:05 CET 2009
Fri Nov 12 18:09:05 CET 2010 Fri Nov 12 18:09:05 CET 2010
Sat Jun 20 18:09:05 CEST 2009 Sat Jun 20 18:09:05 CEST 2009