Originally posted by Hanna Habashy:
The controller doesn't know whether the return value is a list or anything else.
But it can. And certainly much easier than in a JSP.
I believe it should be handled by the view not the controller.
It's the page controller's job to make things as easy for the JSP as possible. I'd use the controller to set a scoped variable such that it's easy to do the right thing on the JSP with the simple EL expressions and JSTL tags that are available to us.
It's always possible to write a custom action or EL function that cold help you here, but I use those as last resorts.
Ben's point about abstracting this to a lower level is also worth pondering.
[ April 29, 2008: Message edited by: Bear Bibeault ]