This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I've found that when using indexed properties, an ArrayList of Arraylists doesn't work very well. What I'd suggest is creating a custom object that contains an arraylist. That way you can add the requisite indexed getter to the object to make it work in this situation.
For example, you could create a Categoria class that has the following methods:
You could then make the ArrayList in your Action form contain a list of Categoria objects. The code you showed us above would now work as long as your ActionForm has the following method:
One more thing: If your ActionForm is in request scope, you will need to give your getters "lazy initialization" behavior in order to avoid getting "index out of range" errors when you submit the form. This link contains further detail. You will also find a working example of using indexed properties here. [ December 15, 2006: Message edited by: Merrill Higginson ]