📄 privilegeform.java
字号:
package com.qrsx.appcam.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 PrivilegeForm extends ActionForm {
private String id;// 编号
private String name;// 名称
private String path;// 路径 对应actionMapping中的path
private String parameter;// 变量 参数
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
//权限名称 路径 变量不能为空
if (name == null || name.trim().length() < 1) {
errors.add("name", new ActionMessage("roleForm.name.required"));
}
if (path == null || path.trim().length() < 1) {
errors.add("path", new ActionMessage("privilegeForm.path.required"));
}
if (parameter == null || parameter.trim().length() < 1) {
errors.add("parameter", new ActionMessage("privilegeForm.parameter.required"));
}
return errors;
}
/**
* @return the id
*/
public String getId() {
return id;
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* @return the parameter
*/
public String getParameter() {
return parameter;
}
/**
* @return the path
*/
public String getPath() {
return path;
}
/**
* @param id
* the id to set
*/
public void setId(String id) {
this.id = id;
}
/**
* @param name
* the name to set
*/
public void setName(String name) {
this.name = name;
}
/**
* @param parameter
* the parameter to set
*/
public void setParameter(String parameter) {
this.parameter = parameter;
}
/**
* @param path
* the path to set
*/
public void setPath(String path) {
this.path = path;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -