1.编写JavaBean类User,在User类中定义name、gender(性别)、education(学历)和email4个可读写属性
package cjz.chapter08.javabean;
public class User {
private String name;
private String gender;
private String education;
private String email;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getEducation() {
return education;
}
public void setEducation(String education) {
this.education = education;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
}
2.编写注册表单页面login.jsp用于填写用户信息
需要注意的是,这里表单项 名称name、性别gender、学历education与User对象中的属性名称一致,而故意将邮箱名称写为mail与User对象中的属性名称emali不一致