Re: [S1] access values of a Map

2007-08-01 Thread Niall Pemberton
On 8/1/07, Alexander Jede <[EMAIL PROTECTED]> 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  JSTL tag or Struts's
:




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)



Niall

> Thanks Alex

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [S1] access values of a Map

2007-08-01 Thread Jasper Floor
On 8/1/07, Alexander Jede <[EMAIL PROTECTED]> wrote:
>
> hmm ok I found it in the package description of bean.
> My problem was, I searched this information in the doc of the taglib (not 
> javadoc).
> Does this work with other tags then  like   ?

In general when using tags I would avoid the javadoc and go for the
taglib doc (actually  always look at the taglib reference, one stop
shop for all you tag needs ;). I believe it also works for other tags,
but don't quote me on thatunless it works.

mvg,
Jasper

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [S1] access values of a Map

2007-08-01 Thread Alexander Jede
Hi,

Am Mittwoch, den 01.08.2007, 12:26 +0200 schrieb Jasper Floor:
...
> I believe you can access indexed properties with bean:write through
> the property attribute.
> 
> 
> I believe this because the struts documentation tells me so. ;)

hmm ok I found it in the package description of bean.
My problem was, I searched this information in the doc of the taglib (not 
javadoc).
Does this work with other tags then  like   ?

Thanks
Alex


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: [S1] access values of a Map

2007-08-01 Thread Jasper Floor
On 8/1/07, Alexander Jede <[EMAIL PROTECTED]> 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 ?

I believe you can access indexed properties with bean:write through
the property attribute.


I believe this because the struts documentation tells me so. ;)

Obviously you don't want [0] but something that lets you select
whatever index you want at the time. I'll leave that as an exercise
for the reader.

mvg,
Jasper

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]