📄 u01dform.java
字号:
package cn.hope.front.form;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;
public class U01Dform extends ActionForm{
public U01Dform(){};
private String name;
private String psw;
private String ts;
public void setName(String name){
this.name=name;
}
public void setPsw(String psw){
this.psw=psw;
}
public String getName() {
return name;
}
public String getPsw() {
return psw;
}
public void setTs(String ts){
this.ts=ts;
}
public String getTs(){
return ts;
}
public void reset(ActionMapping mapping,
HttpServletRequest request) {
this.name = "";
this.psw = "";
this.ts="";
}
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if ((name == null) || (name.equals(""))){
errors.add(ActionErrors.GLOBAL_MESSAGE,
new ActionMessage("U01error.name.required"));
}
if((psw == null) || (psw.equals(""))){
errors.add(ActionErrors.GLOBAL_MESSAGE,new ActionMessage("U01error.psw.required"));
}
if((ts == null) || (ts.equals(""))){
errors.add(ActionErrors.GLOBAL_MESSAGE,new ActionMessage("U01error.ts.required"));
}
return errors;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -