It's not a secret anymore!*
The moose likes Struts and the fly likes No getter method? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "No getter method?" Watch "No getter method?" New topic
Author

No getter method?

Adam Teg
Ranch Hand

Joined: Feb 09, 2006
Posts: 36
I have a form that has a getFname() but I keep on getting "No getter method for property fname of bean result". What else could generate this error?

Seconldy, I would like to have the .java for struts for debugging purposes into my project. Where can I get that?

Thanks
[ August 12, 2006: Message edited by: Bear Bibeault ]
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
What else could generate this error?

A number of other things can generate it, and most of them are clerical errors: misspellings, wrong form bean names, wrong action attribute in your <html:form> tag.

If you'd like help in debuggin it, post the following:

1-The relevant portions of your struts-config.xml file.
2-The relevant portions of your jsp, including the <html:form> tag and all references to the fname property.
3-The ActionForm bean.
I would like to have the .java for struts for debugging purposes into my project. Where can I get that?

Just go to the Struts home page and select the download link. Find the download page for the version of Struts you're using. When you see a page that allows you to select between binaries and source, select source.


Merrill
Consultant, Sima Solutions
Adam Teg
Ranch Hand

Joined: Feb 09, 2006
Posts: 36
Thanks

Here is the code:
<form-bean name="searchForm" type="dummies.form.SearchForm"/>

<actionpath="/search"
type="dummies.action.SearchAction"
name="searchForm"
scope="request"
input="/search.jsp"
validate="true">
<forward name="results" path="/results.jsp"/>
</action>

<logic:iterate id="result" name="searchForm" property="results">
<tr>
<td><bean:write name="result" property="fname"/></td>
</tr>
</logic:iterate>

The bold causes the error but it iterates the correct number of time. I checked it with simple html print. I go have a getFname() in my searchForm.

Thanks
Adam Teg
Ranch Hand

Joined: Feb 09, 2006
Posts: 36
The problem was in the sql and another class. Thanks for your help.
 
Don't get me started about those stupid light bulbs.
 
subject: No getter method?