struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Hoover" <d...@redsquirrel.com>
Subject Newbie logic:iterator question
Date Thu, 17 Oct 2002 11:24:33 GMT
I need to display an HTML table using Struts.  The table contents 
are the results of a database query.  It seems that the <logic:iterate> 
tag is the way to do what I want, but I just cannot seem to get the 
thing to work.

I was just Googling for an answer and came across 
"A Walking Tour of the Struts Example Application"
(http://struts.application-servers.com/struts-layout/tour.htm).
In this Tour, it describes the following  iterate tag like this:

  <logic:iterate name="user" property="subscriptions" id="subscription">
  <!-- block to repeat -->
  </logic:iterate>

  The three parameters to the iterate tag ( name, property, and id)
  tell it to

  1. Check this context for an attribute (e.g. object) named "user",
  2. Snag the property of user named "subscriptions",  
  3. In the block to iterate, use "subscription" (singular) as the
  name for each member of the collection.

I have no idea how or where I define the "user" object.  I can't 
figure out where the Struts example application is defining this.


Also, the object that I want to iterate over is a Vector of HashMaps.
Would I use nested iterate tags?  Is it possible to do what I'm 
trying to do?  I need a bit of guidance, perhaps I'm making this 
too difficult.

Thanks,
Dave the Confused Newbie







--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message