struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ryangr <grigg...@gmail.com>
Subject Re: Optiontransferselect list issue
Date Wed, 02 Apr 2008 15:36:27 GMT

> 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: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Optiontransferselect-list-issue-tp16424054p16447314.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