Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

problem in displaying the searchresults

Status
Not open for further replies.

justme123

Programmer
Oct 9, 2003
14
0
0
US
I have a list SearchResults which contains the searchresults...I have the following code in my jsp:

<logic:iterate id="currentResult" name="GeneralMatterSearchForm" property="searchResults">
<tr class='off'>
<td nowrap><bean:write name="currentResult" property="matterId" /></td>
<td nowrap><bean:write name="currentResult" property="matterName" /></td>
</tr>
</logic:iterate>

In my "GeneralMatterSearchForm" I have the following:
private List searchResults = new ArrayList(0);
public List getSearchResults() {
return searchResults;
}
public void setSearchResults(List l_results) {
this.searchResults = l_results;
}

and all the getters and setters for matterId and matterName

I am getting the foll error

No getter method for property matterId of bean currentResult

Can anybody tell me what i am missing or doing wrong?

thankyou
 
Here is an iterate sample that shows the correct approach:

<logic:iterate id="list" name="userList" >
<tr>
<td><bean:write name="list" property="firstName"/>&nbsp;&nbsp;<bean:write name="list" property="lastName"/></td>

<td><bean:write name="list" property="role"/></td>
<td><bean:write name="list" property="school"/></td>
<td><bean:write name="list" property="OECode"/></td>
<td align="center"><html:link action="/AddOrEditSchoolUser" ><html:img src="layout_files/icon_edit.gif" border="0"/></html:link></td>
<td align="center"><a href="#"><html:img src="layout_files/icon_green_light.gif" border="0" height="16" width="16"/></a></td>
</tr>
</logic:iterate>

Note the Id on the iterate statement should match the name on the <bean:write statment. The name on the iterate statement, in your case GeneralMatterSearchForm and in my sample userList should be an arrayList in your formBean. You're missing the arrayList definition in the formBean. Make sure it's called the same thing as the 'name' in your iterate statement.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top