You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by David Harland <ha...@yahoo.com> on 2009/09/27 21:17:09 UTC

Struts 2 Converting specific List User property

Hi,

I have an UsersAction that has a List<Users> user;

User has the property java.util.Date dateOfBirth

I want to use a default Convertor for java.util.Date in xwork-converion.properties which I know how to do, but I want to have a different Convertor for dateOfBirth. Is this possible and if so how do I specify it in UsersAction-conversion.properties

Thanks

Dave.


      

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Struts 2 Converting specific List User property

Posted by Peter Phillips <pe...@googlemail.com>.
Sounds like you want to apply a converter to the Users class rather
than to the UsersAction itself.

>From the docs (http://struts.apache.org/2.1.6/docs/type-conversion.html#TypeConversion-ApplyingaTypeConvertertoabeanormodel)
you could create a custom converter for the Users class called
Users-conversion.properties with the line
dateOfBirth=com.acme.DateOfBirthConverter.

Peter.

2009/9/27 David Harland <ha...@yahoo.com>:
> Hi,
>
> I have an UsersAction that has a List<Users> user;
>
> User has the property java.util.Date dateOfBirth
>
> I want to use a default Convertor for java.util.Date in xwork-converion.properties which I know how to do, but I want to have a different Convertor for dateOfBirth. Is this possible and if so how do I specify it in UsersAction-conversion.properties
>
> Thanks
>
> Dave.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org