excellent, missed that one, cheers
chico

-----Original Message-----
From: David Winterfeldt [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 30, 2001 5:22 PM
To: [EMAIL PROTECTED]
Subject: Re: getting a specific ArrayList element


The iterate tag has 'offset' and 'length' as
attributes.  You should be able to use both of these
to retrieve a specific element.

http://jakarta.apache.org/struts/struts-logic.html#iterate

length - The maximum number of entries (from the
underlying collection) to be iterated through on this
page. This can be either an integer that directly
expresses the desired value, or the name of a JSP bean
(in any scope) of type java.lang.Integer that defines
the desired value. If not present, there will be no
limit on the number of iterations performed.
[RT Expr]  

offset - The zero-relative index of the starting point
at which entries from the underlying collection will
be iterated through. This can be either an integer
that directly expresses the desired value, or the name
of a JSP bean (in any scope) of type java.lang.Integer
that defines the desired value. If not present, zero
is assumed (meaning that the collection will be
iterated from the beginning.
[RT Expr]  

David

--- "Charlesworth, Chico"
<[EMAIL PROTECTED]> wrote:
> 
> To iterate through a java.util.ArrayList i use
> <logic:iterate> struts tag
> and that works fine ...
> 
> but which tag do i need to use and what attribute
> settings do i need to
> access a specific ArrayList element?
> for example if i wanted to access the second element
> of my ArrayList using
> jsp, i would just do:
> 
> <%MyObject o = (MyObject) myArrayList.get(1);%>
> 
> Any ideas?
> chico
> 
> 
> 
> -- 
> The content of this e-mail is confidential, may
> contain privileged material
> and is intended solely for the recipient(s) named
> above. If you receive this
> in error, please notify Software AG immediately and
> delete this e-mail.
> 
> Software AG (UK) Limited
> Registered in England & Wales 1310740
> Registered Office: Hudson House, Hudson Way,
> Pride Park, Derby DE24 8HS


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

-- 
The content of this e-mail is confidential, may contain privileged material
and is intended solely for the recipient(s) named above. If you receive this
in error, please notify Software AG immediately and delete this e-mail.

Software AG (UK) Limited
Registered in England & Wales 1310740
Registered Office: Hudson House, Hudson Way,
Pride Park, Derby DE24 8HS

Reply via email to