Originally posted by Vishnu Prakash: Is there any problem with the data types in the DTO object.
There's no problem with the data types as long as you're just displaying the values. It's only when you're creating input controls for these values that you would run into problems with non-String properties.
what problems will we run into ? ( I am using indexed properties for first time ...)
In my grid ( which is editable ), my objects contain some int . Will Struts convert it into String before displaying and convert it back to int ? or should I convert into String and take care of int conversion in my Model class. ?
Struts will handle the conversion to and from int, but I still don't think it's a good idea to use it here. Struts will not handle the object wrapper Integer, or any other objects such as java.util.Date.
Here are reasons why it's not a good idea. The first is that uninitialized values will show as "0" instead of blank. Another is that if the user enters a non-numeric value in the field, Struts will throw a NumberFormatException. It's better to define the fields as String in the ActionForm and its contained objects and convert them to other data types later if you need to.
This is one area where Struts 1 is showing its age. Newer frameworks such as JSF and Struts 2 do handle data conversions and provide friendly error messages when the conversion fails. [ July 31, 2007: Message edited by: Merrill Higginson ]