• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

no getter method for a Formbean property

 
karthik meda
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I saw a similar thread here sometime ago, but wasnt able to locate it again ...so i'm posting the same question.
I have JSP file where i am doing the following:-
---------JSP----------------------------
<logic:iterate id="transportAttrs" name="testList" type="com.ibm.bcg.consoleEJB.receiver.TransportAttrInfo" scope="session">
<bean:write name="transportAttrs" property="name" />
</logic:iterate>
---------JSP----------------------------
In my form form bean i have the following :-
------------form Bean-------------
public List getUserTransportAttrs() {
return userTransportAttrs;
}
public void setUserTransportAttrs(List list) {
userTransportAttrs = list;
------------form Bean-------------
My struts-config file has the following:-
-----------------struts-config------------------------
<form-bean name="ReceiverForm" type="com.ibm.bcg.consoleUI.forms.ReceiverForm" />
and my action mappings contain the "ReceiverForm" as the form bean.
-----------------struts-config------------------------
Now when try to access the JSP page i get the error : No getter method for userTransportAttrs in ReceiverForm.
As i have mentioned, i have the getter method,but i dont know why i get this error. I read in the previous posts about checking to see if the original bean has been overridden, but i am not doing anything like that in my action class. I also cleared my browser cache. Someone suggested that i try and chage the name of the form bean, but I cannot change the name of the formbean because it is used in way too many places.
Can somebody help me out here...its really really really urgent...pleas help

Thanks,
karthik
 
Sash Kapoor
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are using two different names on the jsp and the form:
transportAttrs vs userTransportAttrs
 
karthik meda
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am sorry i typed the property name wrong....i was actually changing the property names around in the code, so i pasted the wrong code here. I am using the right property name i.e userTransportAttrs. But I still get the same error.
I just tried another thing...i added another new property called :
providerFlag in my ActionForm.
-----------Form Bean-----------
private int providerFlag=0;
-----------Form Bean-----------
in my JSP code when i try to access the property like this:
----------JSP Code---------
<logic:equal name="ReceiverForm" property="providerFlag" value="1">
<jsp:include page="user-defined-transport.jsp" flush="true" />
</logic:equal>
----------JSP Code---------
Now when i do the above ...i get the same kind of error as the previous one:
error : No getter method for property providerFlag of bean ReceiverForm
So i am guessing my new form properties are not being loaded or that my JSP is getting the latest FormBean. Is the formbean being cached somewhere? or do i have to do anything once i change my formbean, for my struts application to pick up the change? I recompiled my project, I restarted the server...still no respite from the problem though. By the way i am using WSAD 5.1 for all this. Any idea what i can do about this. Hope to hear a reply soon...

Thanks,
karthik
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic