Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Arief Setiawan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 181
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please show us:

1-Your ActionForm class
2-The declaration of this ActionForm and Action in your struts-config.xml file.
 
Arief Setiawan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i use ant to recompile my project
it works!!!

thank's all
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic