Hi,
I'm new to struts, and am trying to use the logic:iterator tag.
My ActionForm had a property 'billList', containing a Collection of objects. Through the logic:iterate I want to display a list of some of the data from the bills.
I have problems getting to the data however. I have tried a number of combinations of id, name and property arguments of the tag, but not getting the results I want.
How would the tag be implemented?
Regards,
Felix
-
jsp struts: logic:iterator (3 messages)
- Posted by: felix planjer
- Posted on: May 03 2004 03:29 EDT
Threaded Messages (3)
- jsp struts: logic:iterator by Senthil Chinnaiyan on May 03 2004 11:42 EDT
- jsp struts: logic:iterator by Senthil Chinnaiyan on May 03 2004 11:49 EDT
- Re: jsp struts: logic:iterator by Sandeep Parkhande on June 04 2008 02:52 EDT
- jsp struts: logic:iterator by Senthil Chinnaiyan on May 03 2004 11:49 EDT
-
jsp struts: logic:iterator[ Go to top ]
- Posted by: Senthil Chinnaiyan
- Posted on: May 03 2004 11:42 EDT
- in response to felix planjer
Let Say, you have a VO, UserVO which contains name, age. Here is the code to display the name and age.
<logic:iterate id="user" name="userList" name="usersForm" property="usersList" type="UserVO">
<TR>
<TD CLASS="VALUE" ALIGN="left">
<bean:write name="user" property="name"/>
</TD>
<TD CLASS="VALUE" ALIGN="left">
<bean:write name="user" property="age"/>
</TD>
</TR>
</logic:iterate>
Here name in iterate is the name of your form, usersList is a property that returns a list of UserVO.
UserVO is a bean, which has name and value attaributes and its getter& setters.
Hope this helps,
Senthil. -
jsp struts: logic:iterator[ Go to top ]
- Posted by: Senthil Chinnaiyan
- Posted on: May 03 2004 11:49 EDT
- in response to Senthil Chinnaiyan
<logic:iterate id="user" name="userList" name="usersForm" property="usersList" type="UserVO">
Sorry, there is a mistake, please ignore name="userList"
Thanks,
Senthil. -
Re: jsp struts: logic:iterator[ Go to top ]
- Posted by: Sandeep Parkhande
- Posted on: June 04 2008 02:52 EDT
- in response to Senthil Chinnaiyan
HI I m getting error java.lang.ClassCastException: java.util.ArrayList for above tag Let mee more Clear VO have two field name and empCode Actionform have getter and setter for someList and in Action class I m adding VO to someList..