Well, I got it working...thanks for the sanity check, Laurie! The
user.groups collection was not getting assigned appropriately at the bottom
of a long, dark path of assignment logic. I suppose a null collection really
isn't technically a collection, hence the exception error message, but the
message could have been a little less obtuse. Apparently null variables
really are useless! </sarcasm> :)

-Ryan

On 4/2/08, Laurie Harper <[EMAIL PROTECTED]> wrote:
>
> 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]
>
>

Reply via email to