You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by chamal desilva <ch...@yahoo.com> on 2006/10/01 08:06:43 UTC
Print value of a map
Hi,
Is there a Struts tag to search and print a value of a
map
for example a tag like this
<c:mapvalue mapname='mymap' key='mykey'/>
where mapname is the name of map in session or request
and key is the key in map to be found.
Thanking You,
Chamal.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Print value of a map
Posted by Antonis Lebesis <an...@gmail.com>.
You can also try:
<bean:write name="myMap" property="myKey"/>
Antonis
On 10/1/06, Paul Benedict <pb...@apache.org> wrote:
> Yes, JSTL provides a way:
>
> <c:out value="${requestScope[var1][var2]}" />
>
> Where var1 is the name of the bean inside the requestScope (or
> sessionScope), and then var2 is the lookup of the bean. The [] notation
> works with any collection.
>
> chamal desilva wrote:
> > Hi,
> >
> > Is there a Struts tag to search and print a value of a
> > map
> >
> > for example a tag like this
> >
> > <c:mapvalue mapname='mymap' key='mykey'/>
> >
> > where mapname is the name of map in session or request
> > and key is the key in map to be found.
> >
> > Thanking You,
> > Chamal.
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam? Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
> >
> > ---------------------------------------------------------------------
> > 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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Print value of a map
Posted by Paul Benedict <pb...@apache.org>.
Yes, JSTL provides a way:
<c:out value="${requestScope[var1][var2]}" />
Where var1 is the name of the bean inside the requestScope (or
sessionScope), and then var2 is the lookup of the bean. The [] notation
works with any collection.
chamal desilva wrote:
> Hi,
>
> Is there a Struts tag to search and print a value of a
> map
>
> for example a tag like this
>
> <c:mapvalue mapname='mymap' key='mykey'/>
>
> where mapname is the name of map in session or request
> and key is the key in map to be found.
>
> Thanking You,
> Chamal.
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> 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