struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ryangr <grigg...@gmail.com>
Subject Re: Type conversion exceptions
Date Mon, 16 Mar 2009 19:04:14 GMT

Well I can't seem to find documentation or examples of how to use the
convertValue() API. This is what each call outputs (it seems both versions
get called each time the converter is run):

Called convertValue(Map, Object, Member, String, Object, Class)
target: com.rjssoft.webdocs.admin.SettingAction@12cb585
member: public void
com.rjssoft.webdocs.admin.SettingAction.setSettings(com.rjssoft.webdocs.setting.SettingList)
propertyName: settings
value (java.util.ArrayList): []
toType: class com.rjssoft.webdocs.setting.SettingList

Called convertValue(Map, Object, Class)
context: ognl.OgnlContext@eb7f1c7f
o (java.util.ArrayList): []
toClass: class com.rjssoft.webdocs.setting.SettingList

It appears both values objects (value and o, respectively) are completely
empty...

Ryan



ryangr wrote:
> 
> That makes sense...I've added a converter for it similar to others that
> already exist in the app, but it doesn't appear to be calling
> convertFromString which the others use. Instead, it seems to be calling
> convertValue(Map, Object, Member, String, Object, Class) which I do not
> see in the Struts 2.0.14 API:
> 
> http://struts.apache.org/2.0.14/struts2-core/apidocs/org/apache/struts2/util/StrutsTypeConverter.html
> 
> Is there documentation on this somewhere that I'm missing? Is this what is
> supposed to be used? None of our other typeconverters use this method
> perhaps because it wasn't documented...
> 
> Ryan
> 
> 
> Lukasz Lenart wrote:
>> 
>> 2009/3/16 ryangr <griggsrl@gmail.com>:
>>> settings is a SettingList which is just an extended ArrayList<Setting>.
>> 
>> That can be a problem, generics are erased during compilation and Ognl
>> doesn't know how to convert array to SettingList, did you try to
>> prepare converter for it?
>> 
>> 
>> Regards
>> -- 
>> Lukasz
>> http://www.lenart.org.pl/
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
>> For additional commands, e-mail: user-help@struts.apache.org
>> 
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Type-conversion-exceptions-tp22497261p22541495.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Mime
View raw message