This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Struts and the fly likes  No getter method for property: Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark " No getter method for property: "cust_id" of bean: "com.myapp. struts.RegActionForm"" Watch " No getter method for property: "cust_id" of bean: "com.myapp. struts.RegActionForm"" New topic

No getter method for property: "cust_id" of bean: "com.myapp. struts.RegActionForm"

Pankaj Shet
Ranch Hand

Joined: Sep 08, 2006
Posts: 286

hello friends,

i am getting frustrated by this error.
actually i had one jsp page,on which there are already some fields present.
for which there was a getter and setter methods and validations in the actionformbean.
there these many fields earlier.
<table border="1" align="center">
<td><bean:message key="" /></td>
<td><html:text property="name" /></td>
<td><bean:message key="cust_reg.address"/></td>
<td><html:textarea property="address"/></td>
<td><bean:message key=""/></td>
<td><html:text property="city"/></td>
<td><bean:message key="cust_reg.pincode"/></td>
<td><html:text property="pincode"/></td>
<td><bean:message key="cust_reg.person"/></td>
<td><html:text property="person"/></td>
<td><bean:message key="cust_reg.designation"/></td>
<td><html:text property="designation"/></td>

<td><html:submit value="next" /></td>

<html:errors />


later on i wanted to add one more field
<td><bean:message key="cust_reg.cust_id"/></td>
<td><html:text property="cust_id"/></td>
to the same form.

on my actionformbean,there were getters and setters methods and the validate method for each of the above mentioned fields.

the one for cust_id i added later.

package com.myapp.struts;

import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

* @author Administrator
* @version

public class RegActionForm extends org.apache.struts.action.ActionForm {
private String cust_id;
private String name;
private String address;
private String person;
private String city;
private String designation;
private String pincode;

* @return

public String getCust_ID(){
return cust_id;

public String getName(){
return name;
public String getAddress(){
return address;
public String getPincode(){
return pincode;
public String getPerson(){
return person;
public String getCity(){
return city;
public String getDesignation(){
return designation;
public void setCust_ID(String Cust_ID ){
public void setName(String string) {
name = string;

public void setAddress(String Address){
address = Address;
public void setPincode(String Pincode){
pincode = Pincode;
public void setPerson(String Person){
person = Person;
public void setCity(String City){
city = City;
public void setDesignation(String Designation){
designation = Designation;
public boolean isNumeric( String test_string ) {
try {
return true;
} catch ( Exception e ) {
return false;

public RegActionForm() {
// TODO Auto-generated constructor stub

public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if((getCust_ID()==null||getCust_ID().length()<1)||(getName() == null || getName().length() < 1)||(getAddress()== null || getAddress().length()<1) || (getCity() == null || getCity().length()<1)||(getPerson()==null||getPerson().length()<1)||(getDesignation()==null||getDesignation().length()<1)||(getPincode()==null||getPincode().length()<1)) {
errors.add("name", new ActionMessage(""));
if (isNumeric(getPincode())== false) {
errors.add("pincode",new ActionMessage("error.pincode.required"));
return errors;

I also added the corresponding field in the application Resource file,as

after doing all this when i tried to run, my project, i am getting the errors.

description The server encountered an internal error () that prevented it from fulfilling this request.


org.apache. jasper.JasperException: Exception in JSP: /Cust_Reg.jsp:37

34: <tbody>
35: <tr>
36: <td><bean:message key="cust_reg.cust_id"/></td>
37: <td><html:text property="cust_id"/></td>
38: </tr>
39: <tr>
40: <td><bean:message key="" /></td>

root cause

javax.servlet. ServletException: No getter method for property: "cust_id" of bean: "com.myapp. struts.RegActionForm"

root cause

javax.servlet. jsp.JspException: No getter method for property: "cust_id" of bean: "com.myapp. struts.RegActionForm"

please help me to solve this problem.

-thanks and regards,
pankaj shet

B.Sc.(I.T.), S.C.J.P., S.C.W.C.D., PGDAC(CDAC)
Shilpa Tendulkar
Ranch Hand

Joined: Jul 29, 2001
Posts: 75
Please check the getter for cust_id, I think it should be getCust_id() instead of getCust_ID();

Pankaj Shet
Ranch Hand

Joined: Sep 08, 2006
Posts: 286

Thanks a lot,Shilpa!!! U were right.!!!I got the answer.!!!
Consider Paul's rocket mass heater.
subject: No getter method for property: "cust_id" of bean: "com.myapp. struts.RegActionForm"
It's not a secret anymore!