- use java code to produce a simpler data structure that can be displayed easily on a JSP.
If this is possible, it certainly is better than scriptlets in JSP or a custom servlet. However, in reality it is possible that such a "simpler" data structure cannot be created. In my example, we are already creating a simplified Presentation data object model from a Storage data object model. The simplified one is still very complex and exceeds the functionality of public tag libraries.
- use a JSP custom tag to handle the display of this complex component, and abstract the complexity away.
This is an option. To handle the complexity mentioned however would require multiple tags, and to get them all to work together would actually be adding complexity, not taking it away. Adding complexity to simply implement a different design is not a good decision, in my opinion. Also, since the tags would never be able to be "reused" in any other type of context, there is little justification for creating a special JSP tag library. Moving the complexity to a tag library is not removing it, it simply is "moving" it and in this case adding extra layers of complexity uneccessarily.
Resorting to servlets to generate markup is the last thing to try to do
True. This would be the last option. It still is an option though. And when that table is generated and viewed in the browser, the customer really doesn't care about how the HTML table was created. The business intelligence derived from the information displayed in the table is the most important thing. Java Servlet imlementations can be very powerful and help realize things that were thought to be not possible.