> -----Original Message----- > From: Marco Mistroni [mailto:[EMAIL PROTECTED] > Sent: Tuesday, December 07, 2004 3:13 AM > To: 'Struts Users Mailing List'; 'Yves Sy' > Subject: RE: getting value of object in a collection via tag > > > Hello yves, > I got lucky :-) .. it worked.... > > <bean:write name="productMaintenanceForm" > property="productContainers[0].uomRef" />
no luck about it.. :) It's designed that way :) > > but unfortunately it's beginning of other problems....... :-( > > thanx anyway for suggestions.. > > regards > marco > > > -----Original Message----- > From: Yves Sy [mailto:[EMAIL PROTECTED] > Sent: 07 December 2004 09:32 > To: Struts Users Mailing List > Subject: Re: getting value of object in a collection via tag > > I believe that wont work. Seems like you have two choices: > > 1. Extract the first element in your action and place it in request > scope so you can use a simple <bean:write> in your jsp; > 2. use <logic:iterate> and set the "length" attribute to 1: > > <logic:iterate name-"myBean" property="vector" length="1" > id="firstBean"> > <bean:write name="firstBean" property="theProperty"/> > </logic:iterate> > > I prefer the 1st option. > > Regards, > -Yves- > > > On Tue, 7 Dec 2004 09:14:41 -0000, Marco Mistroni > <[EMAIL PROTECTED]> wrote: > > Hello , > > Thanx for the reply... > > I was actually wondering if following expression will work also > > > > <bean:write name="myBean" property="vector[0].myProperty"/> ? > > > > assumed that my bean has a method called getVector which returns a > > Collection...... > > > > actually I am not sure if it will work if I use a Collection instead > of > > a Vector... > > > > regards > > > > marco > > > > > > > > -----Original Message----- > > From: Jim Barrows [mailto:[EMAIL PROTECTED] > > Sent: 06 December 2004 17:58 > > To: Struts Users Mailing List > > Subject: RE: getting value of object in a collection via tag > > > > I believe: > > <c:out value="${x[0]}"/> > > will work. > > > > > -----Original Message----- > > > From: Marco Mistroni [mailto:[EMAIL PROTECTED] > > > Sent: Monday, December 06, 2004 10:54 AM > > > To: 'Struts Users Mailing List' > > > Subject: getting value of object in a collection via tag > > > > > > > > > Hi all, > > > 'silly' question...but if I have an ActionForm > > > which has a Property of type Vector, how can I say > > > 'print property x' of the first element? > > > > > > Thanx and regards > > > marco > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > -- > A bus station is where a bus stops. A train station is where a train > stops. On my desk I have a work station... > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]