This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Soft Skills: The software developer's life manual and have John Sonmez on-line!
See this thread for details.
Win a copy of Soft Skills: The software developer's life manual this week in the Jobs Discussion forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

using logic:iterate tag to access ActionForm elements

 
Christian Nash
Ranch Hand
Posts: 107
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have an ActionForm which is like this:


Now in the Action class i set a collection having many objects or ActionForm beans. How do i get the properties of these beans in a jsp using logic:iterate tag
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<logic:iterate id="element" name="myForm" property="sourceList">
<bean:write name="element" property="foo" />
</logic:iterate>

This will give you a list of property "foo" of whatever bean you put in the sourceList or your Form bean. There will be one entry for each item in the list.
 
Christian Nash
Ranch Hand
Posts: 107
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I have a property(Collection) in my Action Form(ExampleForm). This Collection has been set with two ExampleBean objects in my ExampleAction class. I am not able to iterate through the ExampleBean object properties in the jsp page. How do i do it using logic:iterate?
This is my ExampleBean class

This is my ExampleAction Class:

And this is my ExampleForm


I want to iterate through eac of the Beans
Expected output:
Name: Bryan
PLace: USA

Name: Lizzy
Place: Texas
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic