I included the <jsp:useBean />, but I'm still getting the same error... I guess I'm
doing something really stupid, but I'm not sure what. I've copied the the LinkModel
class below:
public class LinkModel implements java.io.Serializable {
private ArrayList resultSet = new ArrayList();
public void setResultSet(LinkQueryForm oneLink) {
resulSet.add(oneLink);
}
public ArrayList getResultSet() {
return this.resultSet;
}
}
In the Action class I adding a LinkQueryForm object to the LinkModel and then putting
the LinkModel on the request object. In the JSP page I use the <jsp:useBean /> tag,
and the iterator tag. I still get the same error:
No getter method for bean linkModel and property resultSet.
This is really irritating since I would like to use the iterate tag instead of the
scriptlets. Am I using the iterate tag wrong? Any help is greatly appreciated!!
Thanks,
Roger Kjensrud
>>> [EMAIL PROTECTED] 02/05/01 03:24PM >>>
I don't see a <jsp:useBean /> tag in your code???
Something like this...
<jsp:useBean
id="linkModel"
scope="request"
class="blah.blah.blah.FormName"
/>
----- Original Message -----
From: "Roger Kjensrud" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 05, 2001 5:54 PM
Subject: Problems with iterate tag
Hello,
I'm trying to use the iterate tag to access a Model object that contains an
ArrayList. The ArrayList in turn contains objects containing the data I
would like to present to the user. However, I can't get it to work. Here's
the code that works:
<%
LinkModel model = (LinkModel)request.getAttribute("linkModel");
ArrayList rs = model.getResultSet();
LinkQueryForm lqForm = (LinkQueryForm)rs.get(0);
%>
Affiliate ID: <%=lqForm.getAffiliateId()%>
Integer ID: <%=lqForm.getIntegerId()%>
In the Action class, I do the following:
request.setAttribute("linkModel", linkModel), where linkModel is an instance
of the LinkModel class.
I thought by using the iterate tag, the following should work:
<logic:iterate id="linkQueryForm" name="linkModel" property="resultSet">
<tr>
<td align="left">
<bean:write name="linkQueryForm" property="affiliateId" filter="true"/>
</td>
<td align="left">
<bean:write name="linkQueryForm" property="categoryId" filter="true"/>
</td>
<td align="left">
<bean:write name="linkQueryForm" property="integerId" filter="true"/>
</td>
</tr>
</logic:iterate>
However, I get the following error:
No getter method for bean linkModel and property resultSet
Well, the the LinkModel contains the getResultSet() method, so I'm little
puzzled here... I'm using the latest nightly build.
Any thoughts would be appreciated!!
Thanks,
Roger Kjensrud