📄 answeraction.java
字号:
package validation;
import java.util.Date;
import model.People;
import com.opensymphony.xwork2.ActionSupport;
public class AnswerAction extends ActionSupport {
String name;
int age;
String answer;
Date birth;
double weight;
String email;
String email2;
String reg;
People people;
public String getReg() {
return reg;
}
public void setReg(String reg) {
this.reg = reg;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public double getWeight() {
return weight;
}
public void setWeight(double weight) {
this.weight = weight;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
public String getAnswer() {
return answer;
}
public void setAnswer(String answer) {
this.answer = answer;
}
public Date getBirth() {
return birth;
}
public void setBirth(Date birth) {
this.birth = birth;
}
public People getPeople() {
return people;
}
public void setPeople(People people) {
this.people = people;
}
public String getEmail2() {
return email2;
}
public void setEmail2(String email2) {
this.email2 = email2;
}
public void validate(){
System.out.println("hi");
if(name.equals("寮犱笁")){
this.addFieldError("namewrong","蹇呴』杈撳叆hello!");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -