This is probably going to be a really simple solution, but after searching I
still haven't quite found an answer so I appreciate any help with this. I'm
using 2.0.14 and trying to do type conversion on a custom collection (called
"settings" in this case, it is just an extended ArrayList). I'm getting the
following in my logs:
Unexpected Exception caught setting
'settings(D176A8AA-1636-4AFF-9C71-16A21DFCEDA7).id' on 'class
com.rjssoft.webdocs.admin.SettingAction: Error setting expression
'settings(D176A8AA-1636-4AFF-9C71-16A21DFCEDA7).id' with value
'[Ljava.lang.String;@1f796d0'
Unexpected Exception caught setting
'settings(D176A8AA-1636-4AFF-9C71-16A21DFCEDA7).title' on 'class
com.rjssoft.webdocs.admin.SettingAction: Error setting expression
'settings(D176A8AA-1636-4AFF-9C71-16A21DFCEDA7).title' with value
'[Ljava.lang.String;@1ce64f6'
Unexpected Exception caught setting
'settings(D176A8AA-1636-4AFF-9C71-16A21DFCEDA7).value' on 'class
com.rjssoft.webdocs.admin.SettingAction: Error setting expression
'settings(D176A8AA-1636-4AFF-9C71-16A21DFCEDA7).value' with value
'[Ljava.lang.String;@6bba64'
Now, obviously it is trying to set a String[] to a String value and failing;
however, according to the "official" doc on type conversion there is no
additional processing. The form consists of:
...
<s:iterator value="%{settings}">
<tr>
<th>
<input name="settings(<s:property value="id" />).id"
value="<s:property
value="id" />" type="hidden" />
<input name="settings(<s:property value="id" />).title"
value="<s:property value="title" />" type="hidden" />
<label for="setting_<s:property value="id" />">
<s:property value="title" />:
</label>
</th>
<td>
<input id="setting_<s:property value="id" />"
name="settings(<s:property value="id" />).value" value="<s:property
value="value" />" />
</td>
</tr>
</s:iterator>
The values that come through are:
Setting params settings(D176A8AA-1636-4AFF-9C71-16A21DFCEDA7).id => [
D176A8AA-1636-4AFF-9C71-16A21DFCEDA7 ]
settings(D176A8AA-1636-4AFF-9C71-16A21DFCEDA7).value => [ 192.168.1.1 ]
settings(D176A8AA-1636-4AFF-9C71-16A21DFCEDA7).title => [ SMTP Server
Address ]
My SettingAction-conversion.properties has(Setting is just a custom bean
object with all id, title, and value along with all getters/setters):
KeyProperty_settings=id
Element_settings=Setting
I followed the examples so I'm not sure where it is going wrong...any help?
Thanks!
Ryan
--
View this message in context:
http://www.nabble.com/Type-conversion-exceptions-tp22497261p22497261.html
Sent from the Struts - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]