The problem is the view property of the DynaActionForm is Object type. Is it a valid type? I checked struts online documentation which lists a couple of valid types but it does not include java.lang.Object!
In a DynaActionForm, as with any ActionForm, properties can be Strings, Booleans, or an object whose properties are strings or booleans. Other types such as Integer and Date will work if all you're doing is outputting them, but if they're being used on input controls, you can run into problems with validation.
java.lang.BigDecimal java.lang.BigInteger boolean and java.lang.Boolean byte and java.lang.Byte char and java.lang.Character java.lang.Class double and java.lang.Double float and java.lang.Float int and java.lang.Integer long and java.lang.Long short and java.lang.Short java.lang.String java.sql.Date java.sql.Time java.sql.Timestamp You may also specify Arrays of these types (e.g. String). You may also specify a concrete implementation of the Map Interface, such as java.util.HashMap, or a List implementation, such as java.util.ArrayList.
If you do not supply an initial attribute, numbers will be initialized to 0 and objects to null.
Joined: Jan 28, 2004
I mean the list doesnt include java.lang.Object. I suppose that is a list of ALL supported types - those not listed are NOT supported.
Joined: Feb 15, 2005
The mechanism behind the DynaActionForm is just a java.util.Map, so really, you can store any object type you wish in a property. I'm not sure why they even make a list of officially supported objects.
It's quite often convenient to nest other objects in your form bean, and use the properties of those objects to display data.
Read the following from the official struts website, and I think you'll understand better why it's OK to put user defined objects in a form.