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 |
|---|---|---|
| et-accusam@amet.com | Sat Jan 10 18:04:02 CET 2009 | 355.00 $ |
| sanctus-dolores@et.com | Fri Mar 27 18:04:02 CET 2009 | 6222.00 $ |
| vero-nonumy@duo.com | Fri May 22 18:04:02 CEST 2009 | 789.00 $ |
| kasd-Lorem@dolores.com | Sat Jun 06 18:04:02 CEST 2009 | 1168.00 $ |
| sadipscing-nonumy@aliquyam.com | Mon Jun 08 18:04:02 CEST 2009 | 8335.00 $ |
| et-ut@justo.com | Thu Sep 17 18:04:02 CEST 2009 | 7075.00 $ |
| sed-invidunt@aliquyam.com | Sat Oct 03 18:04:02 CEST 2009 | 8578.00 $ |
| sanctus-no@ipsum.com | Mon May 10 18:04:02 CEST 2010 | 8650.00 $ |
| takimata-justo@est.com | Tue Jun 29 18:04:02 CEST 2010 | 8091.00 $ |
| est-tempor@Stet.com | Wed Jul 21 18:04:02 CEST 2010 | 5895.00 $ |