• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

logic iterate tag- how to use?

 
Ranch Hand
Posts: 112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what should i put here as property name?
property="property name"
---------------------
<tr class="tblcaption">
<td><bean:message key="tableColumn.Name"/></td>
<td><bean:message key="tableColumn.status"/></td>
<td><bean:message key="tableColumn.source"/></td>
</tr>
<tr class="tblcellseparator">
<td colspan="26"></td>
</tr>

<%GridInfo gridInfo=request.getAttribute("gridInfo");
List testList=gridInfo.getColumnInfoList();
<logic:iterate id="test" name"testList">
<TR>
<TD><bean:write name="test" property="property name "></TD>
</TR>
</logic:iterate>


%>
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What are the elements of testList? What property of the elements of testList do you want to display? For example, if the testList elements have a getter called "getSomeProperty()" which you'd like to display, you'd write:

<bean:write name="test" property="someProperty" />

If you just wanted to call the toString() method of the list elements, then you don't even have to specify property:

<bean:write name="test" />

is equivalent to calling the toString() method of each list element.

I personally would prefer using JSTL:

 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic