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
ea-sadipscing@accusam.com Fri May 21 13:50:58 CEST 2010 6206.00 $
et-clita@dolore.com Sun Nov 15 13:50:58 CET 2009 8275.00 $
sadipscing-Stet@et.com Fri Jul 10 13:50:58 CEST 2009 3577.00 $
magna-sed@erat.com Mon Nov 24 13:50:58 CET 2008 7440.00 $
est-voluptua@sea.com Sun May 24 13:50:58 CEST 2009 3818.00 $
rebum-et@voluptua.com Sun Aug 16 13:50:58 CEST 2009 3641.00 $
dolor-diam@diam.com Sun Dec 20 13:50:58 CET 2009 4396.00 $
takimata-et@dolor.com Tue May 25 13:50:58 CEST 2010 7411.00 $
aliquyam-et@Lorem.com Thu Jul 16 13:50:58 CEST 2009 1262.00 $
gubergren-duo@Lorem.com Wed Sep 16 13:50:58 CEST 2009 4048.00 $