struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Amadei" <daniel.cicero.ama...@gmail.com>
Subject Re: Binding Java 5 Enums..
Date Mon, 12 Feb 2007 10:48:43 GMT
Hi Sami,

There is an example in the showcase webapp which shows how to convert
to/from enums. Give a look, that it might help you.

[]s
Daniel

2007/2/11, Sami Dalouche <skoobi@free.fr>:
> Hi,
>
> I've been trying to bind Java 5 enums, but I get some weird problem....
>
> xwork-conversion.properties
> java.lang.Enum = funala.web.action.typeconverters.TestTypeConverter
>
> TestTypeConverter extends EnumTypeConverter and just adds some logs, to
> make sure the converter is actually used. (I get the same problem by
> using the EnumTypeConverter directly)
>
> So, the weird thing is that binding from the Enum to String works
> perfectly, but the opposite doesn't work..
> (the Enum is SexTraitType, and contains MALE, FEMALE)
>
> [INFO] [2007-02-11 20:58:39,959]
> [funala.web.action.typeconverters.TestTypeConve
> rter] (btpool0-3,) : convertValue: [Ljava.lang.String;@16bfded:class
> funala.doma
> in.entity.profile.traitTypes.SexTraitType
> [INFO] [2007-02-11 20:58:39,959]
> [funala.web.action.typeconverters.TestTypeConve
> rter] (btpool0-3,) : convertFromString: FEMALE:class
> funala.domain.entity.profil
> e.traitTypes.SexTraitType
> [ERROR] [2007-02-11 20:58:39,964]
> [com.opensymphony.xwork2.interceptor.Parameter
> sInterceptor] (btpool0-3,) : ParametersInterceptor - [setParameters]:
> Unexpected
>  Exception catched: Error setting expression 'sexTrait' with value
> '[Ljava.lang.
> String;@16bfded'
>
>
> (and I do have my get/set sexTrait() on the action.
> {
> ..
> }
>
> Does anyone know what could cause the problem ?
>
> Thanks for your help,
> Sami Dalouche
>
>
> ---------------------------------------------------------------------
> 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


Mime
View raw message