我的应用程序中出现此错误

javax.el.PropertyNotFoundException: Property 'survey_id' not found on type com.moh.forms.MOH731
javax.el.BeanELResolver$BeanProperties.get(BeanELResolver.java:229)
javax.el.BeanELResolver$BeanProperties.access$400(BeanELResolver.java:206)
javax.el.BeanELResolver.property(BeanELResolver.java:317)
javax.el.BeanELResolver.getValue(BeanELResolver.java:85)


这是我的MOH731.java

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int survey_id;

public MOH731 (int survey_id, String uname)

@Override
public String toString()
{
return ToStringBuilder.reflectionToString(this);
}
public Integer getId() {
return survey_id;
}

public void setId(Integer survey_id) {
this.survey_id=survey_id;
}


非常感谢您的帮助

最佳答案

您的获取器和设置器的名称错误。

按照惯例,它必须是:

public Integer getSurvey_id() {
   return survey_id;
}

public void setSurvey_id(Integer survey_id) {
   this.survey_id=survey_id;
}

10-07 15:42