You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Twins fan <bl...@freemail.hu> on 2007/08/15 22:28:08 UTC

S2: OGNL beats me

Hi,

I have a bean in request scope which has a List property. I cannot
iterate over it or read it at all. Among the lines below only the first
works. Could somebody please explain why?

${req.css[0]}
<s:property value="req.css[0]"/>
<s:property value="#req.css[0]"/>
<s:property value="%{req.css[0]}"/>
<s:property value="%{#req.css[0]}"/>

Thanks,
kuvera


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


Re: S2: OGNL beats me

Posted by Laszlo Borsos <bl...@freemail.hu>.
Thank you for your answer.
I have picked up some information on OGML, and debug screen helped also.
I am starting to be quite comfortable in Struts 2 and like it a lot.

kuvera


Aram Mkhitaryan írta:
> no, standard EL is quite different,
> 
> here we have value stack,
> 
> if you don't specify the id by #id,
> then it retrieves everything from the root element which is your action,
> 
> so to get from session or request, first use #request or #session
> 
> Best,
> Aram
> ________________________________
> Aram Mkhitaryan
> 
> 52, 25 Lvovyan, Yerevan 375000, Armenia
> 
> Mobile: +374 94 635063
> E-mail: aram.mkhitaryan@googlemail.com
> 


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


Re: S2: OGNL beats me

Posted by Aram Mkhitaryan <ar...@googlemail.com>.
no, standard EL is quite different,

here we have value stack,

if you don't specify the id by #id,
then it retrieves everything from the root element which is your action,

so to get from session or request, first use #request or #session

Best,
Aram
________________________________
Aram Mkhitaryan

52, 25 Lvovyan, Yerevan 375000, Armenia

Mobile: +374 94 635063
E-mail: aram.mkhitaryan@googlemail.com

Re: S2: OGNL beats me

Posted by Twins fan <bl...@freemail.hu>.
Thanks for both of you.

<s:property value="#request.req.css[0]"/>

Only this one works for struts tags, but I still don't fully understand
the notion of the value stack. It is supposed to give access to
properties of all scopes, isn't it? Standard EL is not so complicated.

kuvera


Musachy Barroso írta:
> try :
> 
> <s:property value="%{#request.css[0]}"/>
> 
> musachy


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


Re: S2: OGNL beats me

Posted by Musachy Barroso <mu...@gmail.com>.
try :

<s:property value="%{#request.css[0]}"/>

musachy

On 8/15/07, Twins fan <bl...@freemail.hu> wrote:
> Hi,
>
> I have a bean in request scope which has a List property. I cannot
> iterate over it or read it at all. Among the lines below only the first
> works. Could somebody please explain why?
>
> ${req.css[0]}
> <s:property value="req.css[0]"/>
> <s:property value="#req.css[0]"/>
> <s:property value="%{req.css[0]}"/>
> <s:property value="%{#req.css[0]}"/>
>
> Thanks,
> kuvera
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
"Hey you! Would you help me to carry the stone?" Pink Floyd

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