struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dale Newfield <d...@newfield.org>
Subject Re: What is wrong with my with OGNL Map expression??
Date Thu, 30 Apr 2009 14:06:58 GMT
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


Mime
View raw message