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 |
|---|---|---|
| sanctus-ipsum@tempor.com | Tue Dec 09 21:12:24 CET 2008 | 5070.00 $ |
| consetetur-kasd@vero.com | Tue Aug 17 21:12:24 CEST 2010 | 4501.00 $ |
| kasd-rebum@sed.com | Sat Nov 14 21:12:24 CET 2009 | 7690.00 $ |
| Stet-Stet@no.com | Sat Feb 21 21:12:24 CET 2009 | 5450.00 $ |
| nonumy-et@erat.com | Fri Jul 31 21:12:24 CEST 2009 | 4905.00 $ |
| dolores-et@et.com | Fri Nov 28 21:12:24 CET 2008 | 8769.00 $ |
| sanctus-vero@eos.com | Fri Mar 26 21:12:24 CET 2010 | 467.00 $ |
| et-et@Lorem.com | Mon Apr 26 21:12:24 CEST 2010 | 5221.00 $ |
| dolore-duo@duo.com | Fri Jun 25 21:12:24 CEST 2010 | 4941.00 $ |
| dolor-et@invidunt.com | Wed Oct 20 21:12:24 CEST 2010 | 5433.00 $ |