📄 departmentform.java
字号:
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.support.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: 08-07-2007
*
* XDoclet definition:
* @struts.form name="departmentForm"
*/
public class DepartmentForm extends ActionForm {
/*
* Generated Methods
*/
private int flag;
private String id;
private String name;
private String parentId;
private String description;
/**
* Method validate
* @param mapping
* @param request
* @return ActionErrors
*/
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
// TODO Auto-generated method stub
ActionErrors errors = new ActionErrors();
if (this.flag == 0 || this.flag == 2) return null;
if (this.name == null) return null;
if (this.name.trim().length()<1 || this.name.trim().length()>50) {
errors.add("name",new ActionMessage("部门名称不能超过50字",false));
}
if (this.description.trim().length()>100) {
errors.add("description",new ActionMessage("描述不能超过100字",false));
}
return errors;
}
/**
* Method reset
* @param mapping
* @param request
*/
public void reset(ActionMapping mapping, HttpServletRequest request) {
// TODO Auto-generated method stub
}
public int getFlag() {
return flag;
}
public void setFlag(int flag) {
this.flag = flag;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getParentId() {
return parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -