struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harring Figueiredo" <harri...@gmail.com>
Subject Re: s:select with list from attributes hash map gives list key error
Date Thu, 19 Apr 2007 14:28:20 GMT
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 <darryl@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 <darryl@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 <darryl@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."

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