struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niall Pemberton" <niall.pember...@gmail.com>
Subject Re: [S1] access values of a Map
Date Wed, 01 Aug 2007 17:11:40 GMT
On 8/1/07, Alexander Jede <alexjede@gmx.de> wrote:
> Hallo,
> me bean has a Map attribute.
> Now I want to get access to the values of the Map. But I do not want
> iterate throw the entire Map. In Java I would write something like:
> map.get("key")
> What is the best way to do this in my JSP with struts 1.3.8 ?

If you have a mapped property called "foo" and you want to access the
"bar" key value - then you can use either <c:out> JSTL tag or Struts's
<bean:write>:

<c:out value='${foo.bar}'/>
<bean:write property="foo(bar)"/>

The following might work (can't remember if it does in BeanUtils 1.7.0
- but it will in the upcoming BeanUtils 1.8.0)

<bean:write property="foo.bar"/>

Niall

> Thanks Alex

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


Mime
View raw message