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 think going for an annotation way would be a better solution here. because in that case we can handle all forms initialization inside a single controller all form handling also inside a single controller.
I don't know whether we can have array of command class or array of command names inside single controller much like supported http methods like get and post.
with annotaion when you create the form backing object you have to create all form backing object and set then in model map for preinitialization.
but would you please tell me why you need all forms in a single page.
There is nothing to prevent you from having multiple forms on a page, just don't nest them. Typically with newer versions of spring you use the modelAttribute tag not the commandname tag. You obviously can't submit multiple forms at once, typically you would use AJAX for this. You have not really given us enough information to help you determine if the approach you are taking is the best one.
I think commandname and modelattribute are for diff pupose all-together. command name for initialization purpose by the name pre-intialized form is set in request when displaying form for first time.
model attribute is posted data which is set in request scope. correct me if i am wrong because that's what i know.