You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Darryl Culverwell <da...@bridge-pt.com> on 2007/04/19 15:06:19 UTC

Re: s:select with list from attributes hash map gives list key error

Thanx for your response,

attributes['user.status.options']
produces a list of beans that I'm after.

ie.

Im doing something like this in my action :

List userStatusOptions = getUserStatusOptions();
attributes.put("user.status.options", userStatusOptions);



On Thu, 2007-04-19 at 05:54 -0700, Dave Newton wrote:
> -- Darryl Culverwell <da...@bridge-pt.com> wrote:
> > I have a list of UserStatus beans in my attributes
> > map with key=user.status.
> > 
> > The select looks like this :                        
> > 
> > <s:select 	            
> >   list="attributes['user.status.options']"
> >   label="User Status">
> > </s:select>	
> > 
> > tag 'select', field 'list': The requested list key
> > 'attributes['user.status.options']' could not be
> > resolved as a collection/etc.
> 
> So you're saying that whatever is keyed by
> 'user.status' has a list of options?
> 
> If so, you're including the 'options' part inside the
> map key; I'd think you'd want
> attributes['user.status'].options or something...
> 
> d.
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
-- 
-=Darryl Culverwell=-
Cell:  +27 82 494 1678
Phone: +21 21 448 1395




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: s:select with list from attributes hash map gives list key error

Posted by Harring Figueiredo <ha...@gmail.com>.
This way works too, but you do not have to add it to the attributes. I
believe if you add it to the session, you can retrieve it from the JSP with
the #session notation.

I am glad you got it working.

Hf.
On 4/19/07, Darryl Culverwell <da...@bridge-pt.com> wrote:
>
>
> Got it !!
> Defined a method
>
> public Object getAttribute(String key){
>         return attributes.get(key);
> }
>
>
> <s:select list="%{getAttribute('user.status.options')}" ... >
>
> Strange that I couldn't access the map values directly...
>
> Thanx guys.
>
>
> On Thu, 2007-04-19 at 09:33 -0400, Harring Figueiredo wrote:
> > Try using the session notation.
> >
> > i.e <s:select                    list="#session.attributes['
> > user.status.options']"
> >
> > On 4/19/07, Darryl Culverwell <da...@bridge-pt.com> wrote:
> > >
> > > Cool! thanx.
> > >
> > > I am using a generic action, so there is no actual list in the action.
> > > All the attributes of the bean are inspected and put into the
> attributes
> > > map.
> > >
> > > BTW it does work if there I expose the list in the action directly.
> > >
> > >
> > > On Thu, 2007-04-19 at 06:12 -0700, Dave Newton wrote:
> > > > --- Darryl Culverwell <da...@bridge-pt.com> wrote:
> > > > > attributes['user.status.options'] produces a list of
> > > >
> > > > > beans that I'm after.
> > > > >
> > > > > Im doing something like this in my action :
> > > > >
> > > > > List userStatusOptions = getUserStatusOptions();
> > > > > attributes.put("user.status.options",
> > > > > userStatusOptions);
> > > >
> > > > Oh, I thought you said:
> > > >
> > > > > I have a list of UserStatus beans in my attributes
> > > > > map with key=user.status
> > > >
> > > > Just out of curiosity, why don't you just expose the
> > > > list in the action instead of putting it in a map?
> > > >
> > > > Um... I guess I'm not sure what happens if you provide
> > > > a list of non-primitive types to an <s:select.../>
> > > > without specifying key/value info; hopefully someone
> > > > else will chime in.
> > > >
> > > > d.
> > > >
> > > >
> > > > __________________________________________________
> > > > Do You Yahoo!?
> > > > Tired of spam?  Yahoo! Mail has the best spam protection around
> > > > http://mail.yahoo.com
> > > >
> > > --
> > > -=Darryl Culverwell=-
> > > Cell:  +27 82 494 1678
> > > Phone: +21 21 448 1395
> > >
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > >
> >
> >
> --
> -=Darryl Culverwell=-
> Cell:  +27 82 494 1678
> Phone: +21 21 448 1395
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Sincerely,

Harring Figueiredo
Sr. Software Engineer
Email: harringf@gmail.com
Telephone: 941-256-0600

"We never become truly spiritual by sitting down and wishing to become so.
You must undertake something so great that you cannot accomplish it
unaided."

Re: s:select with list from attributes hash map gives list key error

Posted by Darryl Culverwell <da...@bridge-pt.com>.
Got it !!
Defined a method 

public Object getAttribute(String key){
	return attributes.get(key);
}


<s:select list="%{getAttribute('user.status.options')}" ... >

Strange that I couldn't access the map values directly...

Thanx guys.


On Thu, 2007-04-19 at 09:33 -0400, Harring Figueiredo wrote:
> Try using the session notation.
> 
> i.e <s:select                    list="#session.attributes['
> user.status.options']"
> 
> On 4/19/07, Darryl Culverwell <da...@bridge-pt.com> wrote:
> >
> > Cool! thanx.
> >
> > I am using a generic action, so there is no actual list in the action.
> > All the attributes of the bean are inspected and put into the attributes
> > map.
> >
> > BTW it does work if there I expose the list in the action directly.
> >
> >
> > On Thu, 2007-04-19 at 06:12 -0700, Dave Newton wrote:
> > > --- Darryl Culverwell <da...@bridge-pt.com> wrote:
> > > > attributes['user.status.options'] produces a list of
> > >
> > > > beans that I'm after.
> > > >
> > > > Im doing something like this in my action :
> > > >
> > > > List userStatusOptions = getUserStatusOptions();
> > > > attributes.put("user.status.options",
> > > > userStatusOptions);
> > >
> > > Oh, I thought you said:
> > >
> > > > I have a list of UserStatus beans in my attributes
> > > > map with key=user.status
> > >
> > > Just out of curiosity, why don't you just expose the
> > > list in the action instead of putting it in a map?
> > >
> > > Um... I guess I'm not sure what happens if you provide
> > > a list of non-primitive types to an <s:select.../>
> > > without specifying key/value info; hopefully someone
> > > else will chime in.
> > >
> > > d.
> > >
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam protection around
> > > http://mail.yahoo.com
> > >
> > --
> > -=Darryl Culverwell=-
> > Cell:  +27 82 494 1678
> > Phone: +21 21 448 1395
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
> 
> 
-- 
-=Darryl Culverwell=-
Cell:  +27 82 494 1678
Phone: +21 21 448 1395




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: s:select with list from attributes hash map gives list key error

Posted by Harring Figueiredo <ha...@gmail.com>.
Try using the session notation.

i.e <s:select                    list="#session.attributes['
user.status.options']"

On 4/19/07, Darryl Culverwell <da...@bridge-pt.com> wrote:
>
> Cool! thanx.
>
> I am using a generic action, so there is no actual list in the action.
> All the attributes of the bean are inspected and put into the attributes
> map.
>
> BTW it does work if there I expose the list in the action directly.
>
>
> On Thu, 2007-04-19 at 06:12 -0700, Dave Newton wrote:
> > --- Darryl Culverwell <da...@bridge-pt.com> wrote:
> > > attributes['user.status.options'] produces a list of
> >
> > > beans that I'm after.
> > >
> > > Im doing something like this in my action :
> > >
> > > List userStatusOptions = getUserStatusOptions();
> > > attributes.put("user.status.options",
> > > userStatusOptions);
> >
> > Oh, I thought you said:
> >
> > > I have a list of UserStatus beans in my attributes
> > > map with key=user.status
> >
> > Just out of curiosity, why don't you just expose the
> > list in the action instead of putting it in a map?
> >
> > Um... I guess I'm not sure what happens if you provide
> > a list of non-primitive types to an <s:select.../>
> > without specifying key/value info; hopefully someone
> > else will chime in.
> >
> > d.
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
> >
> --
> -=Darryl Culverwell=-
> Cell:  +27 82 494 1678
> Phone: +21 21 448 1395
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Sincerely,

Harring Figueiredo
Sr. Software Engineer
Email: harringf@gmail.com
Telephone: 941-256-0600

"We never become truly spiritual by sitting down and wishing to become so.
You must undertake something so great that you cannot accomplish it
unaided."

Re: s:select with list from attributes hash map gives list key error

Posted by Darryl Culverwell <da...@bridge-pt.com>.
Cool! thanx.

I am using a generic action, so there is no actual list in the action.
All the attributes of the bean are inspected and put into the attributes
map.

BTW it does work if there I expose the list in the action directly.


On Thu, 2007-04-19 at 06:12 -0700, Dave Newton wrote:
> --- Darryl Culverwell <da...@bridge-pt.com> wrote:
> > attributes['user.status.options'] produces a list of
> 
> > beans that I'm after.
> > 
> > Im doing something like this in my action :
> > 
> > List userStatusOptions = getUserStatusOptions();
> > attributes.put("user.status.options",
> > userStatusOptions);
> 
> Oh, I thought you said:
> 
> > I have a list of UserStatus beans in my attributes 
> > map with key=user.status
> 
> Just out of curiosity, why don't you just expose the
> list in the action instead of putting it in a map?
> 
> Um... I guess I'm not sure what happens if you provide
> a list of non-primitive types to an <s:select.../>
> without specifying key/value info; hopefully someone
> else will chime in.
> 
> d.
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
-- 
-=Darryl Culverwell=-
Cell:  +27 82 494 1678
Phone: +21 21 448 1395




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: s:select with list from attributes hash map gives list key error

Posted by Dave Newton <ne...@yahoo.com>.
--- Darryl Culverwell <da...@bridge-pt.com> wrote:
> attributes['user.status.options'] produces a list of

> beans that I'm after.
> 
> Im doing something like this in my action :
> 
> List userStatusOptions = getUserStatusOptions();
> attributes.put("user.status.options",
> userStatusOptions);

Oh, I thought you said:

> I have a list of UserStatus beans in my attributes 
> map with key=user.status

Just out of curiosity, why don't you just expose the
list in the action instead of putting it in a map?

Um... I guess I'm not sure what happens if you provide
a list of non-primitive types to an <s:select.../>
without specifying key/value info; hopefully someone
else will chime in.

d.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org