I think life would be easier if you store your Category_VO objects in a
java.util.Collection, then use JSTL forEach tag.  Something like this:

<%
        Collection v = new Vector();
      v.add( new Category_VO("cat 1") ); //Assuming your constructor takes a
String which is the shortTitle
      v.add( new Category_VO("cat 2") );
      v.add( new Category_VO("cat 3") );
      v.add( new Category_VO("cat 4") );
        
        request.putAttribute("categories",v);
%>


<c:forEach items="${categories}" var="cat">
        <c:out write="${cat.shortTitle}"/>
</c:forEach>

--Hien

-----Original Message-----
From: e-denton Java Programmer [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 24, 2003 1:24 PM
To: Struts Users Mailing List
Subject: Easy question: iterate


Sorry to bother you with an easy question, but I can't find the answer.

I want to iterate over Category_VO[] which is stored in a session attribute.
I read that it can be done, but I can't find an example for raw arrays.

Here's what I have (which probably doesn't even make sense):

<logic:iterate
 id="category"
 collection="com.cnw.portal.database.Category_VO"
 type="com.cnw.portal.database.Category_VO"
 scope="session">
<p> <bean:write name="category" property="shortTitle"/> </logic:iterate>


Thanks!

will


---------------------------------------------------------------------
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]

Reply via email to