How to access the first item in a Collection in a JSP?

2005-07-06 Thread Mick Knutson
I have a Collection in my ActionForm, and want to access just the first object in that Collection. How can I do this? -- Thanks Mick Knutson (925) 951-4126 HP Consulting Services Safeway (Blackhawk Fastword Project) J2EE Architect --- MMS safeway.com made the following annotations.

Re: How to access the first item in a Collection in a JSP?

2005-07-06 Thread Wendy Smoak
From: Mick Knutson [EMAIL PROTECTED] I have a Collection in my ActionForm, and want to access just the first object in that Collection. How about... %@ taglib uri=http://java.sun.com/jstl/core; prefix=c % c:out value=${form.property[0]}/ -- Wendy Smoak

Re: How to access the first item in a Collection in a JSP?

2005-07-06 Thread Zarar Siddiqi
Wel, I catually have something like form.cards[0].cardNumber, but it is also not an array. It is a collection. Doesn't matter, it works for both as long as you got a getCardNumber() in there. Wendy Smoak wrote: From: Mick Knutson [EMAIL PROTECTED] I have a Collection in my ActionForm,

Re: How to access the first item in a Collection in a JSP?

2005-07-06 Thread Martin Gainty
Mick- Or you could use map entry.. c:forEach var=entry items=${QUERYRESULT[FormName]} c:out value=${entry.key}/ - c:forEach var=eo items='${entry.value}' ${eo.name.value} /c:forEach /c:forEach HTH, Martin- - Original Message - From: Mick Knutson [EMAIL PROTECTED] To: Struts Users

Re: How to access the first item in a Collection in a JSP?

2005-07-06 Thread Mick Knutson
Worked. Thanks.. Zarar Siddiqi wrote: Wel, I catually have something like form.cards[0].cardNumber, but it is also not an array. It is a collection. Doesn't matter, it works for both as long as you got a getCardNumber() in there. Wendy Smoak wrote: From: Mick Knutson [EMAIL