📄 rights_addform.java
字号:
//Created by MyEclipse Struts// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_3.8.4/xslt/JavaClass.xslpackage com.infosys.struts.form;import java.util.ArrayList;import java.util.List;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.util.LabelValueBean;import org.infosys.util.PrivilegeTree;/** * MyEclipse Struts * Creation date: 08-24-2005 * * XDoclet definition: * @struts:form name="rights_addForm" */public class Rights_addForm extends ActionForm { // --------------------------------------------------------- Instance Variables /** parentprvid property */ private String parentprvid; /** url property */ private String url; /** name property */ private String name; /** vieworder property */ private Integer vieworder; /** status property */ private Integer status; /** remark property */ private String remark; /** action property */ private String action; // --------------------------------------------------------- Methods /** * Method validate * @param mapping * @param request * @return ActionErrors */ public ActionErrors validate( ActionMapping mapping, HttpServletRequest request) { if(action!=null && action.equalsIgnoreCase("save")){ ActionErrors errors=new ActionErrors(); if((name==null)||(name.length()<1)){ errors.add("name",new ActionError("tips.this.isNull")); } if((url==null)||(url.length()<1)){ errors.add("url",new ActionError("tips.this.isNull")); } if((parentprvid==null)||(parentprvid.length()<1)){ errors.add("parentprvid",new ActionError("tips.this.isNull")); } if(vieworder==null){ errors.add("vieworder",new ActionError("tips.this.isNull")); } if(status==null){ status=new Integer(1); } //显示select PrivilegeTree objTree=new PrivilegeTree(); List viewlist=new ArrayList(); List sellist=objTree.searchPrv("0"); viewlist.add(new LabelValueBean("---顶级权限---","0")); if(sellist!=null && sellist.size()>0){ for(int i=0;i<sellist.size();i++){ Object[] row = (Object[])sellist.get(i); String prvid = (String)row[0]; String name = (String)row[1]; viewlist.add(new LabelValueBean(name,prvid)); } } request.setAttribute("parentprvid",viewlist); return errors; }else{ return null; } } /** * Method reset * @param mapping * @param request */ public void reset(ActionMapping mapping, HttpServletRequest request) { this.name=null; this.url=null; this.parentprvid=null; this.remark=null; this.status=new Integer(1); this.vieworder=new Integer(0); } /** * Returns the parentprvid. * @return String */ public String getParentprvid() { return parentprvid; } /** * Set the parentprvid. * @param parentprvid The parentprvid to set */ public void setParentprvid(String parentprvid) { this.parentprvid = parentprvid; } /** * Returns the url. * @return String */ public String getUrl() { return url; } /** * Set the url. * @param url The url to set */ public void setUrl(String url) { this.url = url; } /** * Returns the name. * @return String */ public String getName() { return name; } /** * Set the name. * @param name The name to set */ public void setName(String name) { this.name = name; } /** * @return 返回 action。 */ public String getAction() { return action; } /** * @param action 要设置的 action。 */ public void setAction(String action) { this.action = action; } /** * @return 返回 remark。 */ public String getRemark() { return remark; } /** * @param remark 要设置的 remark。 */ public void setRemark(String remark) { this.remark = remark; } /** * @return 返回 status。 */ public Integer getStatus() { return status; } /** * @param status 要设置的 status。 */ public void setStatus(Integer status) { this.status = status; } /** * @return 返回 vieworder。 */ public Integer getVieworder() { return vieworder; } /** * @param vieworder 要设置的 vieworder。 */ public void setVieworder(Integer vieworder) { this.vieworder = vieworder; }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -