aspose file tools*
The moose likes Struts and the fly likes using logic:iterate tag to access ActionForm elements Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "using logic:iterate tag to access ActionForm elements" Watch "using logic:iterate tag to access ActionForm elements" New topic
Author

using logic:iterate tag to access ActionForm elements

Christian Nash
Ranch Hand

Joined: Jan 17, 2006
Posts: 107
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


- Christian
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
<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.


Merrill
Consultant, Sima Solutions
Christian Nash
Ranch Hand

Joined: Jan 17, 2006
Posts: 107
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: using logic:iterate tag to access ActionForm elements