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

📄 testrfcform.java

📁 建立于Eclipse平台的WEB应用系统-物流管理系统变更模块
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package org.mychange.struts.form;

import java.io.UnsupportedEncodingException;

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;
import org.mychange.ValidTime;

/** 
 * MyEclipse Struts
 * Creation date: 07-15-2008
 * 
 * XDoclet definition:
 * @struts.form name="testRFCForm"
 */
public class TestRFCForm extends ActionForm {
	
	private String testName;
	private String beginTime;
	private String endTime;
	private String principal;
	private String brief;
	private String score;
	private String attachment;
	private String phoneNumber;
	/** 
	 * Method validate
	 * @param mapping
	 * @param request
	 * @return ActionErrors
	 */
	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {
		/**
		 * 
		 */
		
		ActionErrors errors=new ActionErrors();

		if(this.getTestName()==null||this.getTestName().equals("")){
			errors.add("testname", new ActionMessage("NotNull.error"));			
		}
		else if(this.getPrincipal()==null||this.getPrincipal().equals("")){
			errors.add("chargeperson",new ActionMessage("NotNull.error"));
		}else if(!(this.getPhoneNumber()==null||this.getPhoneNumber().equals(""))&&!this.getPhoneNumber().matches("\\d{3}-\\d{8}|\\d{4}-\\d{7}|\\d{4}-\\d{8}")){
			errors.add("phoneNumber",new ActionMessage("phone.error"));
		}
	    else if(!ValidTime.checkDate(this.getBeginTime())){
		   errors.add("beginTime", new ActionMessage("Datetype"));
        }else if(!ValidTime.checkDate(this.getEndTime())){
		   errors.add("endTime", new ActionMessage("Datetype"));
        }else if(this.getBrief()==null||this.getBrief().equals("")){
			errors.add("testbrief", new ActionMessage("NotNull.error"));
        }
		
		return errors;
	}

	/** 
	 * Method reset
	 * @param mapping
	 * @param request
	 */
	public void reset(ActionMapping mapping, HttpServletRequest request) {
		// TODO Auto-generated method stub
		try {
			request.setCharacterEncoding("gb2312");
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public String getAttachment() {
		return attachment;
	}

	public void setAttachment(String attachment) {
		this.attachment = attachment;
	}

	public String getBeginTime() {
		return beginTime;
	}

	public void setBeginTime(String beginTime) {
		this.beginTime = beginTime;
	}

	public String getBrief() {
		return brief;
	}

	public void setBrief(String brief) {
		this.brief = brief;
	}

	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}

	public String getPrincipal() {
		return principal;
	}

	public void setPrincipal(String principal) {
		this.principal = principal;
	}

	public String getScore() {
		return score;
	}

	public void setScore(String score) {
		this.score = score;
	}

	public String getTestName() {
		return testName;
	}

	public void setTestName(String testName) {
		this.testName = testName;
	}

	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	public String getPhoneNumber() {
		return phoneNumber;
	}
}

⌨️ 快捷键说明

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