this example from Kumar at JGuru:
//this takes the contents of ArrayListName and assigns an iterator
<logic:iterate id="tempOject" name="ArrayListName" property="fieldobj">
//write out the contents of iterator id based on keyvalue supplied at
property
<bean:write name="tempOject" property="KeyValue" />
Be mindful that Currently, this tag cannot deal with arrays of primitive
data types. Only arrays of Java objects (including Strings) are supported.
Also To populate the ArrayListName in your jsp
Set the String value stored in action and retrieve here in jsp page through
this way . This stores the objectOfArayList inside to ArrayListName
request.setAttribute("ArrayListName", objectOfArayList);
I encourage you ro read the logic: tag information available at
http://www.jajakarta.org/struts/struts1.0/en/target/documentation/struts-logic.html
HTH
Martin-
Is
----- Original Message -----
From: "Wendy Smoak" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Sunday, July 03, 2005 7:53 AM
Subject: Re: Iterate without collection
From: "Tony Smith" <[EMAIL PROTECTED]>
I am using jsp to print out a table. The data (dxx)
comes from a formbean. At the beginning of every row,
I would like to print a character starting from 'A'.
A d11 d12 d13...
B d21 d22 d23...
C d31 d32 d33...
If you put the rows into a TreeMap and use A,B,C... for the keys, then
they will come out in the correct order when you feed the Map to
<logic:iterate>.
But... your subject line says "without collection" so I'm still not sure
what you need here. If you show the form bean property that goes with
this table, and a snippet of JSP where you're trying to do the iteration,
it might make more sense to me.
In another message you asked how to convert 0 to A, 1 to B, etc. If you
add 65 to the int and cast it to char, you'll get the right letter.
--
Wendy Smoak
---------------------------------------------------------------------
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]