This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes logic:iterate problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "logic:iterate problem" Watch "logic:iterate problem" New topic

logic:iterate problem

Shashidahanu Iyyanar
Ranch Hand

Joined: Jun 22, 2005
Posts: 37
Hi All,
I am getting the following problem in my project.I am displaying list of customer names in the main page using the logic:iterate tag.But the problem is that I have to display the names based upon some condition within the tag.How is this possible using Struts?Can anybody give me suggestions regarding this?A example would be much better.Thanks in advance.
Seb Mathe
Ranch Hand

Joined: Sep 28, 2005
Posts: 225

Customer name (conditional) : name will be printed only if aCustomerProperty of the current Customer match aValue.

There's other ways to check a condition, look at the logic tags reference.

Regards,<br />Seb<br /> <br />SCJP 1.4
Pratik Lohia
Ranch Hand

Joined: May 05, 2005
Posts: 88
<logic:iterate id="abc" name="abcList">
<logic:equal name="abc" property="compare" value="xyz"> <bean:write name="abc" property="name" /> </logic:equal></logic:iterate>
It is sorta covered in the JavaRanch Style Guide.
subject: logic:iterate problem
Similar Threads
problem referring to form elements from javascript
Dynamic links
Problem using nested logic:iterate tags
displaying data from arrays with html:text
line feed problem