⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 adddeptformbean.java

📁 考试管理,是的对计算机等级考试报名,管理的具体实现
💻 JAVA
字号:
package myBean;

import java.sql.Date;
import java.util.ArrayList;

import javax.servlet.http.*;
import org.apache.struts.action.*;

import basic.*;

public class AddDeptFormBean extends ActionForm {
	private long id;
	private String dept;
	//private Student student;
	//private Computer computer;
    //private String call;
    //private ArrayList list; 
    public long getId() {
        return this.id;
    }

    /**
     * @param id
     */
    public void setId(long id) {
        this.id= id;
    }
    
   /* public Computer getComputer() {
    	return computer;
    }

    public void setComputer(Computer computer) {
    	this.computer = computer;
    }
*/
    public String getDept() {
    	return dept;
    }

    public void setDept(String dept) {
    	this.dept = dept;
    }
    public ActionErrors validate(ActionMapping mapping,
            HttpServletRequest request) {
		ActionErrors errors = new ActionErrors();
		if (isMissing(getDept())) {
		errors.add("deptMissing",
		new ActionMessage("value.required",
		                "dept"));
		} else if (!isInt(getDept())) {
		errors.add("deptNotInt",
		new ActionMessage("value.int",
		                "dept",
		                getDept()));
		}
		return(errors);
    }
		private boolean isMissing(String value) {
		      return((value == null) || (value.trim().equals("")));
		  }

		  private boolean isInt(String potentialInt) {
		    boolean isInt = true;
		    try {
		      int x = Integer.parseInt(potentialInt);
		    } catch(NumberFormatException nfe) {
		      isInt = false;
		    }
		    return(isInt);
		  }	  
		}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -