struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Hoover" <>
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"
In this Tour, it describes the following  iterate tag like this:

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

  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.

Dave the Confused Newbie

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message