Have you double-checked that getUser().getGroups() is returning what it
should be? I.e. getUser() is not returning null; getUser().getGroups()
is really returning a collection? As a sanity check, what happens if you
include the following in your JSP:
user:
<s:property value="user"/>
<s:property value="getUser()"/>
user.groups:
<s:property value="user.groups"/>
<s:property value="getUser().getGroups()"/>
L.
ryangr wrote:
Are you just missing the getter for user? Struts2 has to call
getUser().getGroups().
The action has getters and setters for both user and groups, and the user
object has a getter/setter for its groups attribute.
I never have these two attributes pointing to the same property. It may
work, but it's the first place I'd look for type conversion problems.
My list attribute always points to a List with key and value entries for
the select and the name attribute always points to a String[] that will
contain the selected key values.
Thanks for the pointer on that, I was wondering what the difference between
them was; however, I don't think that is quite the issue in this case (yet).
Taking your advice on having a String[] for the name attribute, I can do an
<s:updownselect list="groups" name="groupKeys" /> and that collection
displays its data, but when I have <s:updownselect list="user.groups"
name="groupKeys" /> the JSP throws the same exception as the
<s:optiontransferselect> snippet that is causing headaches.
Apr 2, 2008 10:33:18 AM org.apache.catalina.core.ApplicationDispatcher
invoke
SEVERE: Servlet.service() for servlet jsp threw exception
tag 'updownselect', field 'list': The requested list key 'user.groups' could
not be resolved as a collection/array/map/enumeration/iterator type.
Example: people or people.{name} - [unknown location]
It is baffling me at this point because they are the same data type, and
getters/setters exist for all the related objects... *scratches head*
-Ryan
Jeromy Evans - Blue Sky Minds wrote:
ryangr wrote:
With that being said...I can populate the list "groups" just fine, but
when
I try to use "user.groups" to get the other list it throws an exception
that
says: "The requested list key 'user.groups' could not be resolved as a
collection/array/map/enumeration/iterator type." What am I doing wrong?
It's
probably pretty obvious, but this hasn't exactly been a good week for
concentration so far. ;)
Are you just missing the getter for user? Struts2 has to call
getUser().getGroups().
I have the following for code in my JSP:
<s:optiontransferselect
name="user.groups"
list="user.groups"
I never have these two attributes pointing to the same property. It may
work, but it's the first place I'd look for type conversion problems.
My list attribute always points to a List with key and value entries for
the select and the name attribute always points to a String[] that will
contain the selected key values.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]