You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Zoran Avtarovski <zo...@sparecreative.com> on 2009/05/01 02:09:53 UTC
Re: What is wrong with my with OGNL Map expression??
Just to reiterate what Dale said, we¹ve taken to using the %{} across the
board as we were having problems with conflicts. In my experience this has
slowed my hair loss significantly.
Z.
>
> Michael Griffith wrote:
>> > I have a Map<String,String> in the HttpSession
>> > The map is stored in the session as an attribute named
>> > genieProperties...
>
> Kishan G. Chellap Paandy wrote:
>> > Assuming there's an attribute with name 'mySessionAttribute' in the
>> > Session scope
>> > <s:property value="%{#session.mySessionAttribute}" />
>
> Which gets you half way there. It gets you the Map. To get the value
> you want from it, just call it's get method:
>
> <s:property value="%{#session.genieProperties.get('url')}" />
>
> The %{} are often left out by people, but they're critical. That's what
> says "this is an OGNL expression". Musachy's response illustrates the
> potential confusion as to what EL you're using when it's not specified.
>
> -Dale
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>