You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by probertm <pr...@gmail.com> on 2007/05/25 20:54:13 UTC

[newbie] "no getter method .."


Hi, all.

Another newbie question on Struts.  I am having an issue
in getting my .jsp names to match with those in the ActionForm
class and was after some help.

The error coming back from Tomcat is

  Exception in JSP: /search.jsp:56

  53: </tr>
  54: <logic:iterate id="result" name="searchForm" property="results">
  55: <tr>
  56:     <td><bean:write name="result" property="name"/></td>
  57:     <td><bean:write name="result" property="empID"/></td>
  58: </tr>
  59:  </logic:iterate>

  root cause : No getter method for property name of bean result
  
So, this seems to tell me that I am short a method getName() in 
the java class searchForm.  Is that right?

In my SearchForm.java file, I have:

public class SearchForm extends ActionForm {
  private String  name    = "";
  private String  empID   = "";
  private List    results = null;
  
  /**
   * Define all the set / get functions
   */
  public void setName( String name ) {
    this.name = name;
  }
  public String getName() {
    return name;
  }
  
  public void setEmpID( String empID ) {
    this.empID = empID;
  }
  public String getEmpID() {
    return empID;
  }

etc.

So, clearly I am not understanding something here.  
Any help appreciated

Thanks,
-mark.

-- 
View this message in context: http://www.nabble.com/-newbie--%22no-getter-method-..%22-tf3817805.html#a10808597
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: [newbie] "no getter method .."

Posted by Niniva Ray <ni...@yahoo.com>.
No you need a getName() getter method in your ResultBean javabean class.
   
  Regards,
  Niniva

probertm <pr...@gmail.com> wrote:
  

Hi, all.

Another newbie question on Struts. I am having an issue
in getting my .jsp names to match with those in the ActionForm
class and was after some help.

The error coming back from Tomcat is

Exception in JSP: /search.jsp:56

53: 
54: 
55: 
56: 
57: 
58: 
59: 

root cause : No getter method for property name of bean result

So, this seems to tell me that I am short a method getName() in 
the java class searchForm. Is that right?

In my SearchForm.java file, I have:

public class SearchForm extends ActionForm {
private String name = "";
private String empID = "";
private List results = null;

/**
* Define all the set / get functions
*/
public void setName( String name ) {
this.name = name;
}
public String getName() {
return name;
}

public void setEmpID( String empID ) {
this.empID = empID;
}
public String getEmpID() {
return empID;
}

etc.

So, clearly I am not understanding something here. 
Any help appreciated

Thanks,
-mark.

-- 
View this message in context: http://www.nabble.com/-newbie--%22no-getter-method-..%22-tf3817805.html#a10808597
Sent from the Struts - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org



       Shape Yahoo! in your own image.  Join our Network Research Panel today!http://us.rd.yahoo.com/evt=48517/*http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 hot CTA = Join our Network Research Panel