You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Kushan Jayathilake <ku...@gmail.com> on 2010/06/23 12:48:48 UTC

Get a list stored in the session to the struts tag

Hi Guys,

I want to get a list stored in the session and feed that value in to the
iterator... i have done like as shown below, but its not working

<s:iterator value='%{request.getSession().getAttribute("test");}' >

</s:interator>

Can anyone suggest me how to do this..?


-- 
Regards
Kushan Jayathilake

Re: Get a list stored in the session to the struts tag

Posted by Kushan Jayathilake <ku...@gmail.com>.
Yeah that seems working too :)

Thanks mate

-- 
Regards
Kushan Jayathilake



On Wed, Jun 23, 2010 at 4:29 PM, James Cook <Ja...@wecomm.com> wrote:

> Ah ok cool,
>
> Just checked my book and it says
>
> <s:property value="#application.anAppAttribute" />
> <s:property value="#session.aSessionAttribute" />
> <s:property value="#request.aRequestAttribute" />
> <s:property value="#parameters.aRequestParameter" />
>
> Are also valid.
>
> (Bonus points to anyone out there that can name the book ;) )
>
> -----Original Message-----
> From: Kushan Jayathilake [mailto:kushanxp@gmail.com]
> Sent: 23 June 2010 11:55
> To: Struts Users Mailing List
> Subject: Re: Get a list stored in the session to the struts tag
>
> Hi James,
>
> Thank you very much for your quick reply, i have found the way,
>
> <s:iterator value='%{session.test}' >
>
>  no need of that # sign there.
>
> Thanks again, you helped me to solve this :)
>
> --
> Regards
> Kushan Jayathilake
>
>
> On Wed, Jun 23, 2010 at 4:20 PM, James Cook <Ja...@wecomm.com>
> wrote:
>
> > Try %{#session.test}
> >
> > James
> >
> > -----Original Message-----
> > From: Kushan Jayathilake [mailto:kushanxp@gmail.com]
> > Sent: 23 June 2010 11:49
> > To: Struts Users Mailing List
> > Subject: Get a list stored in the session to the struts tag
> >
> > Hi Guys,
> >
> > I want to get a list stored in the session and feed that value in to
> the
> > iterator... i have done like as shown below, but its not working
> >
> > <s:iterator value='%{request.getSession().getAttribute("test");}' >
> >
> > </s:interator>
> >
> > Can anyone suggest me how to do this..?
> >
> >
> > --
> > Regards
> > Kushan Jayathilake
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

RE: Get a list stored in the session to the struts tag

Posted by James Cook <Ja...@wecomm.com>.
Ah ok cool,

Just checked my book and it says

<s:property value="#application.anAppAttribute" />
<s:property value="#session.aSessionAttribute" />
<s:property value="#request.aRequestAttribute" />
<s:property value="#parameters.aRequestParameter" />

Are also valid.

(Bonus points to anyone out there that can name the book ;) )

-----Original Message-----
From: Kushan Jayathilake [mailto:kushanxp@gmail.com] 
Sent: 23 June 2010 11:55
To: Struts Users Mailing List
Subject: Re: Get a list stored in the session to the struts tag

Hi James,

Thank you very much for your quick reply, i have found the way,

<s:iterator value='%{session.test}' >

 no need of that # sign there.

Thanks again, you helped me to solve this :)

-- 
Regards
Kushan Jayathilake


On Wed, Jun 23, 2010 at 4:20 PM, James Cook <Ja...@wecomm.com>
wrote:

> Try %{#session.test}
>
> James
>
> -----Original Message-----
> From: Kushan Jayathilake [mailto:kushanxp@gmail.com]
> Sent: 23 June 2010 11:49
> To: Struts Users Mailing List
> Subject: Get a list stored in the session to the struts tag
>
> Hi Guys,
>
> I want to get a list stored in the session and feed that value in to
the
> iterator... i have done like as shown below, but its not working
>
> <s:iterator value='%{request.getSession().getAttribute("test");}' >
>
> </s:interator>
>
> Can anyone suggest me how to do this..?
>
>
> --
> Regards
> Kushan Jayathilake
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

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


Re: Get a list stored in the session to the struts tag

Posted by Dale Newfield <da...@newfield.org>.
On 6/23/10 6:55 AM, Kushan Jayathilake wrote:
> Thank you very much for your quick reply, i have found the way,
>
> <s:iterator value='%{session.test}'>
>
>   no need of that # sign there.

That probably means that your action has a getSession() method.  Since 
you may use that view layer page from a different action, or you may 
want to get something from the session when something other than your 
action is on top of the value stack, I'd suggest using the # notation.

-Dale

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


Re: Get a list stored in the session to the struts tag

Posted by Kushan Jayathilake <ku...@gmail.com>.
Hi James,

Thank you very much for your quick reply, i have found the way,

<s:iterator value='%{session.test}' >

 no need of that # sign there.

Thanks again, you helped me to solve this :)

-- 
Regards
Kushan Jayathilake


On Wed, Jun 23, 2010 at 4:20 PM, James Cook <Ja...@wecomm.com> wrote:

> Try %{#session.test}
>
> James
>
> -----Original Message-----
> From: Kushan Jayathilake [mailto:kushanxp@gmail.com]
> Sent: 23 June 2010 11:49
> To: Struts Users Mailing List
> Subject: Get a list stored in the session to the struts tag
>
> Hi Guys,
>
> I want to get a list stored in the session and feed that value in to the
> iterator... i have done like as shown below, but its not working
>
> <s:iterator value='%{request.getSession().getAttribute("test");}' >
>
> </s:interator>
>
> Can anyone suggest me how to do this..?
>
>
> --
> Regards
> Kushan Jayathilake
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

RE: Get a list stored in the session to the struts tag

Posted by James Cook <Ja...@wecomm.com>.
Try %{#session.test}

James

-----Original Message-----
From: Kushan Jayathilake [mailto:kushanxp@gmail.com] 
Sent: 23 June 2010 11:49
To: Struts Users Mailing List
Subject: Get a list stored in the session to the struts tag

Hi Guys,

I want to get a list stored in the session and feed that value in to the
iterator... i have done like as shown below, but its not working

<s:iterator value='%{request.getSession().getAttribute("test");}' >

</s:interator>

Can anyone suggest me how to do this..?


-- 
Regards
Kushan Jayathilake

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