For Programmers: Free Programming Magazines  


Home > Archive > Java Help > April 2004 > Struts issue... "No getter method for property..."









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Struts issue... "No getter method for property..."
goa_head

2004-04-25, 8:35 pm

I've seen this problem posted a lot and have recently ran into it.
Trying the various suggestions hasn't worked...

I have an ArrayList which gets put into the Session object by one of
my classes via session.setAttribute. The ArrayList is populated with
various "Forum" objects. I try to iterate through the arraylist with
this on a JSP:

<logic:iterate id="forums" name="forumList">
<tr><td colspan=2><FONT face="Verdana" size="-2">
<b><bean:write name="forums" property="forumName"/></b><br>
</td></tr>
</logic:iterate>

That makes me get the "No getter method for property forumName of bean
forums" error. If I remove the bean:write statement and replace it
with static text, the text gets repeated for the number of items on
the ArrayList, so I *know* it's looping through the objects. It's just
not seeing getForumName().
The arraylist is composed of various "Forum" objects these look like
the following:
------------------------------
public class Forum {

//Variable declarations
private String forumName;

/** Creates a new instance of Forum */
public Forum(String newForumName) {
this.forumName= newForumName;
} //end Forum

public String getForumName() {
return this.forumName;
} //end getForumName

public void setForumName(String newForumName) {
this.forumName = newForumName;
} //end setForumName
} //end class Forum
-------------------------

Any ideas? Any help would be appreciated!
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com