displaytag is an advanced library for displaying tables of data in an HTML page. It takes care of the implementation for paging, sorting, cropping, grouping, and the display of data in tables. Additionally, displaytag has built-in options for exporting table data to popular formats such as CSV, Excel, PDF, and XML.
See http://displaytag.sourceforge.net/.