HTML large table construction

Recently, I had to build a HTML page with 8 large tables (number of line > 150) on it. I tried 3 solutions:

  • Download of the table content through AJAX call and javascript creation with table.insertRow() and row.insertCell().
  • Download of the table content through AJAX call and javascript creation by creating a large string with the table content and then set a div.innerHTML content.
  • Server side generation.

The results are quite surprising. From the 3 solutions, the second one is the most performing.

Before explaining in detail the difference of the 3 approaches, I should mention that using the 3rd solution, the page size was about 600K. This give an idea of the tables size.

1. AJAX and insertRow() approach

This solution works quite well. However, it has some drawbacks.

It only works on IE. Indeed, insertRow() is not standard Javascript. And the table generation is quite expansive in term of CPU load.

2. Ajax and table construction using string and innerHTML

This is the most performing approach. The table construction take half the time of the 1st approach

3. No AJAX and table construction on the server side

This really surprised me. I was expecting this approach to be the most performing not taking into account the download time. And surprisingly, this is not the case. The table rendering on the client is 2 times slower that the 1st approach and 4 times slower than the second. Why is that, I can’t really explain. Maybe, is it due to the page structure (the 8 tables are rendered in hidden div used to create tab rendering).

Ubuntu installation

This is done.
For a long time (very long for common windows users – 2 years!!), I didn’t install a new OS on my machine. I was just upgrading my mandrake distro.

Finally, I decided to move to Ubuntu and start from scratch. What a pleasure !!

The installation went fine. All the hardware was discovered properly and I really enjoy working with the Ubuntu package manager.

Apache and mod_encoding

Recently we had the following issue with a web application. The form submission of text area containg the ampersand (&) character was not correctly transfered to the web application.

The web application was receiving the request with more parameter than expected. In fact the ampersand in the textarea field content was acting as a separator. When point directly to the machine (with http://:8080), everything was working properly. So the problem was not Tomcat.

After some research, I decided to comment the usage of mod_encoding in httpd.conf and …. it worked.

In fact, by default the mod_encoding was applied to all request, although it is only needed for the webdav directories.

My conclusion

Automate installation is nice but has some limitation

JasperReport – Tapestry integration

I was looking for a way to integrate JasperReport within a Tapestry application. Looking into Google, I  found the following post from Lothar Resinger on the Tapestry maling list.

The post refers to a JasperPdfDownloadService aims to run JasperReport report by passing it the hibernate session connection and a set of parameters.

In my case, the report data were not coming from a database but were provided as a JRBeansCollectionDataSource. Therefor I take the idea of Lothar and refactor it to work with any kind of datasource.

The goals was to provide