aspose file tools*
The moose likes Struts and the fly likes no getter method for property:... of bean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "no getter method for property:... of bean "InboxForm"" Watch "no getter method for property:... of bean "InboxForm"" New topic
Author

no getter method for property:... of bean "InboxForm"

Arief Setiawan
Greenhorn

Joined: Sep 06, 2006
Posts: 12
Hi All,

I'm begginer at struts and have strange problem
I have InboxForm bean that contain inboxList with type Collection and
inboxid with type String[].
in my class already getter for both properties.

in jsp:
...
<logic:empty name="InboxForm" property="InboxList" >
<tr>
<td colspan="5">Inbox Empty</td>
</tr>
</logic:empty>
...

and i got this error :
No getter method for property: "InboxList" of bean: "InboxForm"

i have read previous threads and trying to use solutions from there,
such as : change case of 1st and 2nd to lower, change InboxList to inboxes (lower case)
i still got same error.

but, if i use inboxid, it is work without any problem
...
<logic:empty name="InboxForm" property="inboxid" >
<tr>
<td colspan="5">Inbox Empty</td>
</tr>
</logic:empty>
...

is there special case if we use Collection type?


Best Regards
Arief Setiawan
Dom Lassy
Ranch Hand

Joined: May 05, 2006
Posts: 181
What is the getter in InboxForm for inboxList? Try changing <logic:empty name="InboxForm" property="InboxList"> to <logic:empty name="InboxForm" property="inboxList">
Arief Setiawan
Greenhorn

Joined: Sep 06, 2006
Posts: 12
i still got same error
i have try to change inboxList to InboxList
InboxList to inboxList
change to inboxes, Inboxes

both of InboxForm bean and jsp

but i still got same error
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Please show us:

1-Your ActionForm class
2-The declaration of this ActionForm and Action in your struts-config.xml file.


Merrill
Consultant, Sima Solutions
Arief Setiawan
Greenhorn

Joined: Sep 06, 2006
Posts: 12
thank's Merrill,

here is my ActionForm class:

public class InboxForm extends org.apache.struts.action.ActionForm {

private String button;
private String[] inboxid;
private java.util.Collection inboxList;

. . .

public String getButton() {
return button;
}

public void setButton(String button) {
this.button = button;
}

public String[] getInboxid() {
return inboxid;
}

public void setInboxid(String[] inboxid) {
this.inboxid = inboxid;
}

public java.util.Collection getInboxList() {
return inboxList;
}

public void setInboxList(java.util.Collection inboxList) {
this.inboxList = inboxList;
}
}



decalration form bean on struts-config.xml:
<form-bean name="InboxForm" type="com.myproject.form.InboxForm">
<form-property name="inboxid" type="java.lang.String[]"/>
<form-property name="button" type="java.lang.String"/>
<form-property name="inboxList" type="java.util.Collection"/>
</form-bean>


declaration action on struts-config.xml:
<action name="InboxForm" path="/inbox" scope="session" type="com.myproject.action.InboxAction">
<forward name="InboxDetail" path="/pages/InboxDetail.jsp"/>
<forward name="InboxDelete" path="/pages/inbox.jsp"/>
</action>


i got error when run inbox.jsp at this lines:
<logic:empty name="InboxForm" property="inboxList" >
<tr>
<td colspan="5">Inbox Empty</td>
</tr>
</logic:empty>


regards,
Arief Setiawan
Greenhorn

Joined: Sep 06, 2006
Posts: 12
Dear All, i have build this struts with eclipse & exadel

when i decompile InboxForm.class, i found that this class still have 2 properties : inboxid and button.


btw, how to make eclipse automaticaly recompile my class when i have mofified my java code?
thank's in advance

regards
Arief Setiawan
Greenhorn

Joined: Sep 06, 2006
Posts: 12
i use ant to recompile my project
it works!!!

thank's all
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: no getter method for property:... of bean "InboxForm"