Java 使用spring和bean列表创建表单
我知道也有类似的问题,但我不能让它工作。但请容忍我 这是我的豆子Java 使用spring和bean列表创建表单,java,spring,spring-mvc,Java,Spring,Spring Mvc,我知道也有类似的问题,但我不能让它工作。但请容忍我 这是我的豆子 public class FLTQuestionnaireBean { private int myQuestionId; private int myQuestionNum; private String myQuestion; private String myQuestionAnswer; private String myQuestionType; private Strin
public class FLTQuestionnaireBean
{
private int myQuestionId;
private int myQuestionNum;
private String myQuestion;
private String myQuestionAnswer;
private String myQuestionType;
private String myQuestionModule;
private String myQuestionStrand;
private String myQuestionDifficulty;
// getters and setters here
}
和我的包装类:
public class QuestionnaireBeanWrapper
{
private List<FLTQuestionnaireBean> myQuestionnaireBeanList;
public void add( FLTQuestionnaireBean questionnaireBean )
{
myQuestionnaireBeanList.add( questionnaireBean );
}
//getter and setter here
}
我运行应用程序时遇到异常。我从一开始就收到错误,请更改此设置
<form:form id="reading-form" action="../index/FLT_evaluate_reading.do" method="POST" modelAttribute="${ wrapper }">
并在控制器中打印结果,您将看到如下内容
com.somepackage.QuestionnaireBeanWrapper
它尝试使用它来解析模型属性,解析
之前的每个标记,在模型
属性中找不到的第一个标记失败。在这种情况下,Model
属性中没有名为com
,因此它会抱怨并失败。更改此设置
<form:form id="reading-form" action="../index/FLT_evaluate_reading.do" method="POST" modelAttribute="${ wrapper }">
并在控制器中打印结果,您将看到如下内容
com.somepackage.QuestionnaireBeanWrapper
它尝试使用它来解析模型属性,解析
之前的每个标记,在模型
属性中找不到的第一个标记失败。在这种情况下,Model
属性中没有名为com
,因此它会抱怨并失败。更改此设置
<form:form id="reading-form" action="../index/FLT_evaluate_reading.do" method="POST" modelAttribute="${ wrapper }">
并在控制器中打印结果,您将看到如下内容
com.somepackage.QuestionnaireBeanWrapper
它尝试使用它来解析模型属性,解析
之前的每个标记,在模型
属性中找不到的第一个标记失败。在这种情况下,Model
属性中没有名为com
,因此它会抱怨并失败。更改此设置
<form:form id="reading-form" action="../index/FLT_evaluate_reading.do" method="POST" modelAttribute="${ wrapper }">
并在控制器中打印结果,您将看到如下内容
com.somepackage.QuestionnaireBeanWrapper
它尝试使用它来解析模型属性,解析
之前的每个标记,在模型
属性中找不到的第一个标记失败。在这种情况下,在模型
属性中没有名为com
,因此它会抱怨并失败。检查包装器类中get er的拼写应该是这样的
public List<FLTQuestionnaireBean> getQuestionnaireBeanList{
return myQuestionnaireBeanList
};
public List getquestionnairebanlist{
返回我的问题列表
};
检查包装器类中get er的拼写应该是这样的
public List<FLTQuestionnaireBean> getQuestionnaireBeanList{
return myQuestionnaireBeanList
};
public List getquestionnairebanlist{
返回我的问题列表
};
检查包装器类中get er的拼写应该是这样的
public List<FLTQuestionnaireBean> getQuestionnaireBeanList{
return myQuestionnaireBeanList
};
public List getquestionnairebanlist{
返回我的问题列表
};
检查包装器类中get er的拼写应该是这样的
public List<FLTQuestionnaireBean> getQuestionnaireBeanList{
return myQuestionnaireBeanList
};
public List getquestionnairebanlist{
返回我的问题列表
};
我更新了我的帖子。我按照您的建议应用了更改,但仍然存在堆栈跟踪。我还打印了wrapper.toString()
,是的,它像这样打印com.neu.als.thesis.db.beans。QuestionnaireBeanWrapper@5f39cb
对不起,你能换个说法吗?我更新了我的帖子。我按照您的建议应用了更改,但仍然存在堆栈跟踪。我还打印了wrapper.toString()
,是的,它像这样打印com.neu.als.thesis.db.beans。QuestionnaireBeanWrapper@5f39cb
对不起,你能换个说法吗?我更新了我的帖子。我按照您的建议应用了更改,但仍然存在堆栈跟踪。我还打印了wrapper.toString()
,是的,它像这样打印com.neu.als.thesis.db.beans。QuestionnaireBeanWrapper@5f39cb
对不起,你能换个说法吗?我更新了我的帖子。我按照您的建议应用了更改,但仍然存在堆栈跟踪。我还打印了wrapper.toString()
,是的,它像这样打印com.neu.als.thesis.db.beans。QuestionnaireBeanWrapper@5f39cb
对不起,谢谢你的快速回复,我检查了它,是的,它是这样的。谢谢你的快速回复,我检查了它,是的,它是那样的。谢谢你的快速回复,我检查了它,是的,它是那样的。谢谢你的快速回复,我检查了它,是的,它是那样的。