Thanks Claire

That's really quite simple and exactly the answer to my question.
The jsp with the logic:iterate now loops through the beans contained in the
vector. Just had to add the vector to my Form.

Thanks for the quick reply.

/Paulo Murphy de Freitas

----- Original Message -----
From: "Claire Wall" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Subject: Re: iterate with Vector

Hi Paulo,

Assuming that your Bean class contains simple data types you can do the
following:

<logic:iterate id="id" name="FormName" property="VectorName">
<bean:write name="id" property="PropertyName"/>
</logic:iterate>

So, for example, if you had a Bean with two fields, 'name' and 'phone' in
it, your form was called 'PeopleForm' in struts-config and your vector of
bean objects was called 'people', you could output the bean details to the
screen for each bean in the vector list like so:

<logic:iterate id="person" name="PeopleForm" property="people">
<bean:write name="person" property="name"/>
<bean:write name="person" property="phone"/>
</logic:iterate>


hope this helps.
claire

----- Original Message -----
From: "Paulo Murphy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 29, 2004 9:02 AM
Subject: iterate with Vector


> Hi,
>
> new to the list so hello to all.
>
> Have a problem.
> I'm trying to use the logic:iterate tag with a vector.
>
> This vector is a vector of Beans.
> Can't see to figure out how to iterate over this vector of Beans.
>
> This is probably not enough information but hopefully someone will reply
> and I can provide more info.
>
> Thanks in advance
>
> /Paulo Murphy de Freitas


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

Reply via email to