我是Spring MVC框架的新手,我遇到了问题。尝试将表单的信息绑定到我的控制器时,会发生以下错误:
“bean类的无效属性'isDifferentLanguage'[de.pwc.form.FPagesCheckForm]:Bean属性'isDifferentLanguage'不可读或具有无效的getter方法:getter的返回类型是否与参数类型匹配设定器?“
我的目的是证明是否选中了一些复选框。奇怪的是,这段代码适用于我的.jsp文件的第二个和第三个复选框。但是对于第一个复选框“文档中的不同语言?”尽管我已经实现了属性的getter和setter,但它仍无法正常工作。
这是我的.jsp文件的一部分:
Different language in the documents? <form:checkbox path="isDifferentLanguage"/><br/>
Only compareNumbers <form:checkbox path="onlyCompareNumbers"/><br/>
Markup <form:checkbox path="markup"/><br/>
这是我的表格:
private int startPageOld;
private int endPageOld;
private int startPageNew;
private int endPageNew;
private boolean isDifferentLanguage;
private boolean onlyCompareNumbers;
private boolean markup;
// Files
private CommonsMultipartFile[] fileDatas;
public CommonsMultipartFile[] getFileDatas() {
return fileDatas;
}
public void setFileDatas(CommonsMultipartFile[] fileDatas) {
this.fileDatas = fileDatas;
}
public int getStartPageOld() {
return startPageOld;
}
public void setStartPageOld(int startPageOld) {
this.startPageOld = startPageOld;
}
public int getStartPageNew() {
return startPageNew;
}
public void setStartPageNew(int startPageNew) {
this.startPageNew = startPageNew;
}
public int getEndPageOld() {
return endPageOld;
}
public void setEndPageOld(int endPageOld) {
this.endPageOld = endPageOld;
}
public int getEndPageNew() {
return endPageNew;
}
public void setEndPageNew(int endPageNew) {
this.endPageNew = endPageNew;
}
public boolean isOnlyCompareNumbers() {
return onlyCompareNumbers;
}
public void setOnlyCompareNumbers(boolean onlyCompareNumbers) {
this.onlyCompareNumbers = onlyCompareNumbers;
}
public boolean isMarkup() {
return markup;
}
public void setMarkup(boolean markup) {
this.markup = markup;
}
public boolean isDifferentLanguage() {
return isDifferentLanguage;
}
public void setDifferentLanguage(boolean isDifferentLanguage) {
this.isDifferentLanguage = isDifferentLanguage;
}
如果您需要更多信息,请告诉我!谢谢你的帮助!