You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Michael Mehrle <mi...@datasaur.com> on 2002/02/04 20:37:18 UTC

JSP/Struts question: Best way to loop through an array/list/enumeration on my JSP?

Is there a struts-specific tag allowing me to loop through an array (list)
of strings and have them be printed sequentially? I am currently populating
a template JSP from the database - the way I retrieve the page content is by
tagging a contentID to the end of the request, like this:

http://myserver/app/getpage.do?cid=42

Now, I have a 'related' field in my content table, which is a simpe list of
other page cids. What I need to do is to retrieve go to those other content
entries, retrieve the linktext field and THEN loop through it on my JSP.

Everything until the looping is no problem - at firsthand I was simply
considering to just pull in the data and then pre-process some
HTML/JavaScript tags in my bean that gets the db data. However, after giving
it a second thought I was pretty sure that this is a common task and that
there must be something out there that allows me to loop through an
array/list/enumeration or something.

ANY input would be very welcome.

Cheers,

Michael



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: JSP/Struts question: Best way to loop through an array/list/enumeration on my JSP?

Posted by Thomas Paul <tg...@yahoo.com>.
--- Michael Mehrle <mi...@datasaur.com> wrote:
> However, after giving
> it a second thought I was pretty sure that this is a
> common task and that
> there must be something out there that allows me to
> loop through an
> array/list/enumeration or something.

Do you mean like the logic:iterate tag?


__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>