📄 expert_uploadform.java
字号:
package struts.form;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.upload.FormFile;
public class Expert_uploadForm extends ActionForm {
private String rname;
private String sex;
private String zhiwu;
private String zhiche;
private String memo;
private FormFile file;
public ActionErrors validate(
ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if (rname == null ||rname.trim().equals("")) {
errors.add("rname", new ActionError("error.uid"));
}
if (sex == null ||sex.trim().equals("")) {
errors.add("sex", new ActionError("error.sex"));
}
if (zhiwu == null ||zhiwu.trim().equals("")) {
errors.add("zhiwu", new ActionError("error.zhiwu"));
}
if (zhiche == null ||zhiche.trim().equals("")) {
errors.add("zhiche", new ActionError("error.zhiche"));
}
if (memo == null ||memo.trim().equals("")) {
errors.add("memo", new ActionError("error.memo"));
}
return errors;
}
public void reset(ActionMapping mapping, HttpServletRequest request)
{
rname = "";
memo="";
sex="";
zhiwu="";
zhiche="";
}
public String getRname() {
return rname;
}
public void setRname(String rname) {
this.rname = rname;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public String getZhiwu() {
return zhiwu;
}
public void setZhiwu(String zhiwu) {
this.zhiwu = zhiwu;
}
public String getZhiche() {
return zhiche;
}
public void setZhiche(String zhiche) {
this.zhiche = zhiche;
}
public String getMemo() {
return memo;
}
public void setMemo(String memo) {
this.memo = memo;
}
public FormFile getFile() {
return file;
}
public void setFile(FormFile file) {
this.file = file;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -