struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Scott Koenig <>
Subject using a custom Converter for elements of a Collection
Date Wed, 12 Jan 2011 21:43:48 GMT

In my company's internal CMS, we are implementing two new asset types,
Videos and Playlists (collections of Videos). In the Video UI, the user
designates which Playlists are to be associated with a given Video, and
these values are posted on save via an array called "playlists" which
contains the UIDs of each Playlist. These are represented as an
ArrayList<Playlist> in the Video POJO.

We have implemented a PlaylistConverter to convert each String UID to a
Playlist instance (and back), and going off of,
added Element_playlists=[converterpackage].PlaylistConverter to

Save was not committing and there seemed to be some conversion error, so I
stepped through the conversion process to try and determine what was going
wrong. Everything seems to be fine at the Collection level; it properly
determines that the toType of the collection is List and the memberType is
Playlist. However, when XWorkConverter.getConverter() tries to find the
converter for the individual members, even though Element_playlists=class
[converterpackage].PlaylistConverter is present in the mappings, the
property String passed in is still "playlists" instead of
"Element_playlists" and thus it does not hook up the playlist ID with the
converter and falls back to the default converter (which cannot handle it
and is what is raising the error).

Any guidance as to what could be going wrong here would be greatly

Thank you very much,

PS--If it's useful, our system depends on the following libraries:


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message