提示错误:No getter method for property login of bean form但是我怎么也看不出来错在哪里呀,请高手指点...小弟初学struts,遇到这样的问题真是很打击人呀,想了很久也不明白,百度了也未果....谢谢好心人...<action path="/HtmlTagAction"
name="HtmlTagActionForm"
type="HtmlTagAction"
validate="false"
scope="request">
<forward name="ss" path="/helloresult.jsp"/>
</action>
public class HtmlTagAction
extends Action {
public ActionForward execute(ActionMapping actionMapping,
ActionForm actionForm,
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse) { HtmlTagActionForm form = (HtmlTagActionForm) actionForm;
httpServletRequest.setAttribute("form", form);
return actionMapping.findForward("ss");
}}
public class HtmlTagActionForm extends ActionForm{
private String loginName;
private String password;
private String biography;
private String storePassword;
private String interests[];
private String gender;
private String resume;
private String diploma; /**
* @return Returns the loginName.
*/
public String getLoginName() {
return loginName;
}
/**
* @param login The loginName to set.
*/
public void setLoginName(String loginName) {
this.loginName = loginName;
}
/**
* @return Returns the password.
*/
public String getPassword() {
return password;
}
/**
* @param password The password to set.
*/
public void setPassword(String password) {
this.password = password;
} /**
* @return Returns the biography.
*/
public String getBiography() {
return biography;
}
/**
* @param login The biography to set.
*/
public void setBiography(String biography) {
this.biography = biography;
} /**
* @return Returns the storePassword.
*/
public String getStorePassword() {
return storePassword;
}
/**
* @param storePassword The storePassword to set.
*/
public void setStorePassword(String storePassword) {
this.storePassword = storePassword;
} /**
* @return Returns the interests.
*/
public String[] getInterests() {
return interests;
}
/**
* @param interests The interests to set.
*/
public void setInterests(String[] interests) {
this.interests = interests;
} /**
* @return Returns the gender.
*/
public String getGender() {
return gender;
}
/**
* @param gender The gender to set.
*/
public void setGender(String gender) {
this.gender = gender;
} /**
* @return Returns the resume.
*/
public String getResume() {
return resume;
}
/**
* @param resume The resume to set.
*/
public void setResume(String resume) {
this.resume = resume;
}
/**
* @return Returns the diploma.
*/
public String getDiploma() {
return diploma;
}
/**
* @param diploma The diploma to set.
*/
public void setDiploma(String diploma) {
this.diploma = diploma;
}
}<html:form action="/HtmlTagAction">
<table align="center">
<tr>
<td>登录名:</td>
<td><html:text property="loginName"/></td>
</tr>
<tr>
<td>密码:</td>
<td><html:password property="password" maxlength= "16" size="20"/></td>
</tr> <tr>
<td></td>
<td><html:checkbox property="storePassword"/><font size="2" color="blue">请记住我的密码!</font></td>
</tr> <tr>
<td>性别:</td>
<td>
男<html:radio property="gender" value="male"></html:radio>
女<html:radio property="gender" value="female"></html:radio>
</td>
</tr> <tr>
<td>学历:</td>
<td>
<html:select property="diploma">
<html:option value="doctor"></html:option>
<html:option value="master"></html:option>
<html:option value="bachelor"></html:option>
</html:select>
</td>
</tr> <tr>
<td>兴趣爱好:</td>
<td><html:multibox property="interests" value="swiming"/>游泳<html:multibox property="interests" value="tennis"/>网球<html:multibox property="interests" value="socer"/>足球</td>
</tr> <tr>
<td>个人简介:</td>
<td><html:textarea property="biography" rows="5" cols="20"/></td>
</tr></table><br>
<div align="center" >
<html:submit value="提交"></html:submit>
<html:reset value="重置"></html:reset>
<html:cancel value="取消"></html:cancel>
</div>
</html:form>
<table align="center">
<tr>
<td>登录名:</td>
<td><bean:write name="form" property="loginName"/></td>
</tr>
<tr>
<td>密码:</td>
<td><bean:write name="form" property="password"/></td>
</tr> <tr>
<td align="center"><font size="2" color="red">您的密码已保存!</font></td>
</tr> <tr>
<td>性别:</td>
<td><bean:write name="form" property="gender"/></td>
</tr> <tr>
<td>学历:</td>
<td><bean:write name="form" property="diploma"/></td>
</tr> <tr>
<td>兴趣爱好:</td>
<td>
<logic:iterate id="box" name="form" property="interests">
<%=box%>
</logic:iterate>
</td>
</tr>
<tr>
<td>个人简介:</td>
<td><bean:write name="form" property="biography"/></td>
</tr></table>
name="HtmlTagActionForm"
type="HtmlTagAction"
validate="false"
scope="request">
<forward name="ss" path="/helloresult.jsp"/>
</action>
public class HtmlTagAction
extends Action {
public ActionForward execute(ActionMapping actionMapping,
ActionForm actionForm,
HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse) { HtmlTagActionForm form = (HtmlTagActionForm) actionForm;
httpServletRequest.setAttribute("form", form);
return actionMapping.findForward("ss");
}}
public class HtmlTagActionForm extends ActionForm{
private String loginName;
private String password;
private String biography;
private String storePassword;
private String interests[];
private String gender;
private String resume;
private String diploma; /**
* @return Returns the loginName.
*/
public String getLoginName() {
return loginName;
}
/**
* @param login The loginName to set.
*/
public void setLoginName(String loginName) {
this.loginName = loginName;
}
/**
* @return Returns the password.
*/
public String getPassword() {
return password;
}
/**
* @param password The password to set.
*/
public void setPassword(String password) {
this.password = password;
} /**
* @return Returns the biography.
*/
public String getBiography() {
return biography;
}
/**
* @param login The biography to set.
*/
public void setBiography(String biography) {
this.biography = biography;
} /**
* @return Returns the storePassword.
*/
public String getStorePassword() {
return storePassword;
}
/**
* @param storePassword The storePassword to set.
*/
public void setStorePassword(String storePassword) {
this.storePassword = storePassword;
} /**
* @return Returns the interests.
*/
public String[] getInterests() {
return interests;
}
/**
* @param interests The interests to set.
*/
public void setInterests(String[] interests) {
this.interests = interests;
} /**
* @return Returns the gender.
*/
public String getGender() {
return gender;
}
/**
* @param gender The gender to set.
*/
public void setGender(String gender) {
this.gender = gender;
} /**
* @return Returns the resume.
*/
public String getResume() {
return resume;
}
/**
* @param resume The resume to set.
*/
public void setResume(String resume) {
this.resume = resume;
}
/**
* @return Returns the diploma.
*/
public String getDiploma() {
return diploma;
}
/**
* @param diploma The diploma to set.
*/
public void setDiploma(String diploma) {
this.diploma = diploma;
}
}<html:form action="/HtmlTagAction">
<table align="center">
<tr>
<td>登录名:</td>
<td><html:text property="loginName"/></td>
</tr>
<tr>
<td>密码:</td>
<td><html:password property="password" maxlength= "16" size="20"/></td>
</tr> <tr>
<td></td>
<td><html:checkbox property="storePassword"/><font size="2" color="blue">请记住我的密码!</font></td>
</tr> <tr>
<td>性别:</td>
<td>
男<html:radio property="gender" value="male"></html:radio>
女<html:radio property="gender" value="female"></html:radio>
</td>
</tr> <tr>
<td>学历:</td>
<td>
<html:select property="diploma">
<html:option value="doctor"></html:option>
<html:option value="master"></html:option>
<html:option value="bachelor"></html:option>
</html:select>
</td>
</tr> <tr>
<td>兴趣爱好:</td>
<td><html:multibox property="interests" value="swiming"/>游泳<html:multibox property="interests" value="tennis"/>网球<html:multibox property="interests" value="socer"/>足球</td>
</tr> <tr>
<td>个人简介:</td>
<td><html:textarea property="biography" rows="5" cols="20"/></td>
</tr></table><br>
<div align="center" >
<html:submit value="提交"></html:submit>
<html:reset value="重置"></html:reset>
<html:cancel value="取消"></html:cancel>
</div>
</html:form>
<table align="center">
<tr>
<td>登录名:</td>
<td><bean:write name="form" property="loginName"/></td>
</tr>
<tr>
<td>密码:</td>
<td><bean:write name="form" property="password"/></td>
</tr> <tr>
<td align="center"><font size="2" color="red">您的密码已保存!</font></td>
</tr> <tr>
<td>性别:</td>
<td><bean:write name="form" property="gender"/></td>
</tr> <tr>
<td>学历:</td>
<td><bean:write name="form" property="diploma"/></td>
</tr> <tr>
<td>兴趣爱好:</td>
<td>
<logic:iterate id="box" name="form" property="interests">
<%=box%>
</logic:iterate>
</td>
</tr>
<tr>
<td>个人简介:</td>
<td><bean:write name="form" property="biography"/></td>
</tr></table>
<form-bean name="HtmlTagActionForm" type="HtmlTagActionForm"></form-bean>
这个意思是有一个bean的属性login没有对应的get方法,你的哪里有这个属性?
现在struts2用多了,struts1的不太记得了