struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Prasad, Kamakshya" <kpra...@capitalservicing.co.jp>
Subject RE: struts logic-iterate and accessing nested index properties
Date Fri, 14 May 2004 00:35:40 GMT
Hi,

It can as well be done in struts using this

<logic:iterate id="element" name="FooForm" property="fooBean"
indexId="index"> 
<li><em>
<bean:write name="element" property="attID"/>
</em>&nbsp;
[<bean:write name="index"/>]</li> 
</logic:iterate>

KP

-----Original Message-----
From: PADALA, SANDHYA (SBCSI) [mailto:sp4835@sbc.com] 
Sent: Friday, May 14, 2004 5:28 AM
To: Struts Users Mailing List
Subject: RE: struts logic-iterate and accessing nested index properties

Thank you Tim. I used JSTL , that solved my problem

-----Original Message-----
From: Slattery, Tim - BLS [mailto:Slattery.Tim@bls.gov] 
Sent: Thursday, May 13, 2004 1:58 PM
To: 'Struts Users Mailing List'
Subject: RE: struts logic-iterate and accessing nested index properties


> In my JSP I have coded the following
> <logic:iterate id="element" name="FooForm" property="fooBean" 
> indexId="index"> <li><em><bean:write name="element" 
> property='<%= "fooBean[" + index + "].attID" 
> %>'/></em>&nbsp;[<bean:write name="index"/>]</li> </logic:iterate>
> 
> When I run the JSP I get the following error
> Error 500: No getter method for property fooBean[0].attID of 
> bean element 

Use JSTL:

<c:forEach items="${FooForm.FooBean}" var="fooBean">
   <c:out value="${fooBean.attID}"/>
</c:forEach>


--
Tim Slattery
Slattery_T@bls.gov


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message