Hi guys,
I am facing a problem. The scenario is, I want to iterate a vector using logic:iterate tag and write a value in JspWriter using a bean:write tag which is embedded in a object that is stored in the vector.
<logic:iterate id="list" name="listForm" property="vectorList">
<bean:write name="list" property="name"/>
</logic:iterate>
I've tried in this way, where name is a property of a object that stored in the vectorList. But it doesn't print any thing since its looking for a nested property name in the vector. How i can over come this problem. I f some one has any idea abt it pls. help me.
Thanks in advance
-
Struts Iterator tag (2 messages)
- Posted by: Tomson Antony
- Posted on: February 05 2003 23:49 EST
Threaded Messages (2)
- Struts Iterator tag by prajakt deshpande on February 06 2003 01:13 EST
- type by Mike Perham on February 06 2003 10:08 EST
-
Struts Iterator tag[ Go to top ]
- Posted by: prajakt deshpande
- Posted on: February 06 2003 01:13 EST
- in response to Tomson Antony
Use this way (type attribute to the logic:iterate tag) ....
<logic:iterate id="list" name="listForm" property="vectorList" type="yourclassname">
<bean:write name="list" property="name"/>
</logic:iterate>
hope it helps .... -
type[ Go to top ]
- Posted by: Mike Perham
- Posted on: February 06 2003 10:08 EST
- in response to prajakt deshpande
You shouldn't use the type attribute unless you need to access the element directly in a scriptlet.
<logic:iterate name="mybean" property="vectorProperty" id="element">
<bean:write name="element" property="name"/>
</logic:iterate>
Should work fine as long as you have an Object called "mybean" in context with a getVectorProperty() method.