📄 deptform.java
字号:
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package org.lxh.struts.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;
/**
* MyEclipse Struts Creation date: 06-12-2007
*
* XDoclet definition:
*
* @struts.form name="deptForm"
*/
public class DeptForm extends ActionForm {
/*
* Generated fields
*/
/** type property */
private String type;
/** dname property */
private String dname;
/** loc property */
private String loc;
/** deptno property */
private String deptno;
/** business property */
private String business;
/*
* Generated Methods
*/
/**
* Method validate
*
* @param mapping
* @param request
* @return ActionErrors
*/
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if ("0".equals(type)) {
// Type = 0 :表示全部查询或模糊查询,全不验证
} else if ("1".equals(type)) {
// Type = 1 :表示插入操作,验证部门名称,部门位置及部门业务是否为空
if (this.dname == null || "".equals(this.dname)) {
errors.add("dname", new ActionMessage("null.dept.dname"));
}
if (this.loc == null || "".equals(this.loc)) {
errors.add("locs", new ActionMessage("null.dept.loc"));
}
if (this.business == null || "".equals(this.business)) {
errors.add("business", new ActionMessage("null.dept.business"));
}
} else if ("2".equals(type)) {
// Type = 2 :表示删除操作、按ID查询操作,则验证部门的编号
if (this.deptno == null || "".equals(this.deptno)) {
errors.add("deptno", new ActionMessage("null.dept.deptno"));
}
} else {
// Type = 3 : 表示更新操作,则验证部门的全部信息,包括编号,名称、位置,业务
if (this.deptno == null || "".equals(this.deptno)) {
errors.add("deptno", new ActionMessage("null.dept.deptno"));
}
if (this.dname == null || "".equals(this.dname)) {
errors.add("dname", new ActionMessage("null.dept.dname"));
}
if (this.loc == null || "".equals(this.loc)) {
errors.add("locs", new ActionMessage("null.dept.loc"));
}
if (this.business == null || "".equals(this.business)) {
errors.add("business", new ActionMessage("null.dept.business"));
}
}
return errors;
}
/**
* Method reset
*
* @param mapping
* @param request
*/
public void reset(ActionMapping mapping, HttpServletRequest request) {
// TODO Auto-generated method stub
}
/**
* Returns the type.
*
* @return String
*/
public String getType() {
return type;
}
/**
* Set the type.
*
* @param type
* The type to set
*/
public void setType(String type) {
this.type = type;
}
/**
* Returns the dname.
*
* @return String
*/
public String getDname() {
return dname;
}
/**
* Set the dname.
*
* @param dname
* The dname to set
*/
public void setDname(String dname) {
this.dname = dname;
}
/**
* Returns the loc.
*
* @return String
*/
public String getLoc() {
return loc;
}
/**
* Set the loc.
*
* @param loc
* The loc to set
*/
public void setLoc(String loc) {
this.loc = loc;
}
/**
* Returns the deptno.
*
* @return String
*/
public String getDeptno() {
return deptno;
}
/**
* Set the deptno.
*
* @param deptno
* The deptno to set
*/
public void setDeptno(String deptno) {
this.deptno = deptno;
}
/**
* Returns the business.
*
* @return String
*/
public String getBusiness() {
return business;
}
/**
* Set the business.
*
* @param business
* The business to set
*/
public void setBusiness(String business) {
this.business = business;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -