Your data is declared as HashMap<String,Object>
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<String, Date>* userPropsAsDate;
private *HashMap<String, Integer>* userPropsAsInt;
private *HashMap<String, String>* userPropsAsStr;
// Setter and Getter
}
And use the appropriate map for particular data type.
BTW, I didn't test it.
You can try it and see if it works.
2010/10/27 Sathish Kumar <[email protected]>:
> 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 I use a Date Picker component as below ….
>
>
>
> [[email protected] name="*user. dateOfBirth* " label="Date Of Birth" /]
>
>
>
> Everything works fine !!! and I see *dateOfBirth populated with
> java.util.Date*
>
>
>
> But …. In some cases , My Action Class is generic .. so I have to use a
> HashMap to store the values ..
>
>
>
> // Action Class
>
> Public Class MyProblematicActionClass{
>
> Private *HashMap<String,Object>* userAsMap ;
>
> // Setter and Getter
>
> }
>
>
>
> And HTML as,
>
>
>
> [[email protected] name=" *userAsMap. dateOfBirth* " label="Date Of Birth" /]
>
>
>
> But this time, userAsMap. *dateOfBirth is populated as String value rather
> than Date* value …..
>
>
>
> Is this problem solvable ? if yes, how do we do that ?
>
>
>
> Any help here will be great …..
>
>
>
> Thanks & Regards,
>
> Sathish Kumar T
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]