I'm relatively new to Struts and the other day while going through some code at work I noticed a very large form bean - i.e. more than 200 attributes in it (mostly Strings and Lists). We are using Struts 1.2, by the way.
I guess the reason for this 'heavy' form bean is because the pages its used in are quite complex - there's a tabbed layout with a few tables and lots of field-sets of data - text fields and the like (some editable) within each tabbed section. So all this information is captured in this one form.
Note that there are several action classes dealing with the various submits or user actions, etc - just that the information is held in the one form bean.
Is this generally acceptable - have people faced similar situations and is there a better alternative? I would think having such a large form bean would impact performance as well. Your thoughts?
Some people use a single form bean for the entire application--"acceptable" is in the eyes of the beholder. I don't *prefer* it. The only way a large class would have a big impact on performance is if it's a session bean, there's a bunch of them around, and it's chock full of data.
A Struts 1 page that's accessed via a single action only has one form bean available to it via the framework--the form bean named in the "name" parameter of the action config. Unless something has been done in your system to overcome that framework limitation it's probably the easiest solution.
Not knowing any further details it's hard to say how bad (or good) it is, though.