Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/375.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java jsp中的PropertyNotFoundException_Java_Jsp - Fatal编程技术网

Java jsp中的PropertyNotFoundException

Java jsp中的PropertyNotFoundException,java,jsp,Java,Jsp,我在应用程序中遇到此错误 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.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;
}

getter和setter命名约定应符合
Id
属性

更改
private int survey\u id
私有int-Id


在JSP中使用
id
,而不是
survey\u id
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;
}