Re: Reg: Issue with Struts 2 Data Binding

2010-10-27 Thread Sathish Kumar
Hi, Thanks for the response ... I will try this ... Regards, Sathish Kumar T On Wed, Oct 27, 2010 at 3:05 PM, Li Ying wrote: > May be you can copy all the properties from a map > to an instance of your model class. > > You can implement this by > (1)[BeanUtils.populate] > of Apache Commons Bea

Re: Reg: Issue with Struts 2 Data Binding

2010-10-27 Thread Li Ying
May be you can copy all the properties from a map to an instance of your model class. You can implement this by (1)[BeanUtils.populate] of Apache Commons BeanUtils See: http://commons.apache.org/beanutils/apidocs/org/apache/commons/beanutils/BeanUtils.html#populate%28java.lang.Object,%20java.util.

Re: Reg: Issue with Struts 2 Data Binding

2010-10-27 Thread Maurizio Cucchiara
Since you have entities that share *date of birth *, Why don't you consider using interface power? You could modify your code in order to manage DOB, by implementing a simple (f.e.) HumanBeing interface. public interface HumanBeing{ Date getDateOfBirth(); void setDateOfBirth(Date); } } Then you co

Re: Reg: Issue with Struts 2 Data Binding

2010-10-27 Thread Sathish Kumar
Hi Li, Thanks ... Unfortunately, In my case, Map represents various java model classes at run time ( User, Employee etc ). So I will get the values in a Single Hash Map ( Using BeanUtils.describe ).. But Yes... as you said, By default struts 2 determine the Object Type using Type of the attribute

Re: Reg: Issue with Struts 2 Data Binding

2010-10-27 Thread Li Ying
Your data is declared as HashMap So Struts2 don't know what data type the parameter should be converted to. My suggestion: Change your Action class likes: Public Class ActionClass{ private *HashMap* userPropsAsDate; private *HashMap* userPropsAsInt; private *HashMap* userPropsAsStr; // Setter

Reg: Issue with Struts 2 Data Binding

2010-10-27 Thread Sathish Kumar
Hi Group, I have a below issue with Data Binding. Consider we have below code //Model Class Public Class User { Private *Date* dateOfBirth; // Setter and Getter } // Action Class Public Class MyActionClass{ Private *User* user ; // Setter and Getter } In My HTML