📄 powerform.java
字号:
package com.qrsx.qrsxcrm.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;
@SuppressWarnings("serial")
public class PowerForm extends ActionForm {
private String id; //主键
private String powerName; //权限名称
private String action; //权限所对应的动作
private String resources; //权限资源(url或实体对象)
/**
* FORM表单验证
*/
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if((powerName == null)||(powerName.length()<1)){
errors.add("powerName",new ActionMessage("system.power.powerName"));
}
if((action == null)||(action.length()<1)){
errors.add("action",new ActionMessage("system.power.action"));
}
if((resources == null)||(resources.length()<1)){
errors.add("resources",new ActionMessage("system.power.resources"));
}
return errors;
}
/**
* @return the action
*/
public String getAction() {
return action;
}
/**
* @param action the action to set
*/
public void setAction(String action) {
this.action = action;
}
/**
* @return the id
*/
public String getId() {
return id;
}
/**
* @param id the id to set
*/
public void setId(String id) {
this.id = id;
}
/**
* @return the powerName
*/
public String getPowerName() {
return powerName;
}
/**
* @param powerName the powerName to set
*/
public void setPowerName(String powerName) {
this.powerName = powerName;
}
/**
* @return the resources
*/
public String getResources() {
return resources;
}
/**
* @param resources the resources to set
*/
public void setResources(String resources) {
this.resources = resources;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -