Specify the 'type' attribute for the <logic:iterate>.  The value should be the fully 
qualified class name of each 'result' object.

Sri

-----Original Message-----
From: Brian Hart [mailto:[EMAIL PROTECTED]] 
Sent: Friday, February 21, 2003 3:31 PM
To: [EMAIL PROTECTED]
Subject: Re: Understanding the Iterate Tag


Your Example still Failed.  I received a no 'getter' method found for property 
Description.  As suggested I found the user guide and the logic below seems to be the 
proper equilvalent syntax of the scriptlet loop sample.  Does anyone else have further 
insight on the appropriate way to return a set of JavaBeans?  I am using JavaBeans to 
represent the Model and often want to return an array of them.  I don't use the 
ActionForm beans for this purpose as best practices indicate that you should not use 
the actionform as your model which makes perfect sense.  I was just confused as to the 
most efficient mechanism for passing the model back to the JSP page to render.  
Currently most of my business logic is design to bringback Javabean[] arrays when sets 
of data (not SQL Data, but various search engine results being consolidated into one 
searchResultBean)  are involved

<%
SearchResultBean[] c = (SearchResultBean[]) session.getAttribute("results");

for (int x = 0; x < c.length; x++){
  out.println(c[x].getDescription());
  
}
%>

<logic:iterate collection="results" id="result">
   <bean:write name="result" property="description"/> </logic:iterate>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to