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

📄 kensyoupdateactionform.java

📁 用strutshibernate做的项目
💻 JAVA
字号:
//Created by MyEclipse Struts
// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_4.0.1/xslt/JavaClass.xsl

package com.dut.struts.form;

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

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 com.dut.logic.logic.InputCheckUtil;
import com.dut.logic.util.NumberUtil;

/**
 * MyEclipse Struts Creation date: 04-11-2006
 * 
 * XDoclet definition:
 * 
 * @struts.form name="kensyoUpdateActionForm"
 */
public class KensyoUpdateActionForm extends ActionForm {
	private String submit_button;

	private String nen_H;

	private String hagaki_id_H;

	private String toukyu_id_H;

	// --------------------------------------------------------- Instance
	// Variables

	// --------------------------------------------------------- Methods

	/**
	 * Method validate
	 * 
	 * @param mapping
	 * @param request
	 * @return ActionErrors
	 */
	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {
		ActionErrors errors = new ActionErrors();
		Date sz_time = null;
		Date sk_time = null;
		int lastnumber = 0;
		String sz = "";
		String L_num = "";
		String sk = "";

		if (request.getParameter("name") != null) {
			String name = request.getParameter("name");
			System.out.println("name======>" + name);
			/** **********判断点击的是[更新]按钮********** */
			if (name.equals("gengxin")) {
				/** *******************判断下桁数长度不为1 或者 为空************************* */
				if ((request.getParameter("lastnumber")).length() != 1
						|| request.getParameter("lastnumber") == null) {
					System.out.println("name1122======>" + name);
					errors.add("message", new ActionError("lastnumber_empty"));
					return errors;
				}

				if (request.getParameter("lastnumber") != null) {
					L_num = request.getParameter("lastnumber");
					boolean b_lnum = NumberUtil.isnotNum(L_num);// 判断半角数字
					/** ****************如果不是半角数字************** */
					if (b_lnum == true) {
						errors.add("message", new ActionError("e_tlastnumber"));
						return errors;
					}
					lastnumber = Integer.parseInt(L_num);
				}
				/** *******************如果开始日付为空***************************** */
				if (request.getParameter("sz_time") == null
						|| request.getParameter("sz_time").equals("")) {
					errors.add("message", new ActionError("szyear_empty"));
					return errors;

				}
				/** *********************如果结束日付为空*********************** */
				if (request.getParameter("sz_time") != null
						&& request.getParameter("sz_time").length() != 0
						&& request.getParameter("sz_time").equals("") == false) {
					sz = (String) request.getParameter("sz_time");
					sk = request.getParameter("h_sk");
					sk_time = InputCheckUtil.Turn_Date(sk);
					boolean b_sz = InputCheckUtil.isnotDateformat(sz);// 判断结束日付的格式

					if (b_sz == true)// 如果格式不正确
					{
						errors.add("message", new ActionError("e_sz_year"));
						return errors;
					}
					sz_time = InputCheckUtil.Turn_Date(sz);
					boolean b_wen = sz_time.after(sk_time);// 判断时间先后
					/** ****************如果开始日付在结束日付之后**************** */
					if (b_wen == false) {
						errors.add("message", new ActionError("when"));
						return errors;

					}

				}
			}// update if

		} // zui wai if
		// TODO Auto-generated method stub
		return errors;
	}

	/**
	 * Method reset
	 * 
	 * @param mapping
	 * @param request
	 */
	public void reset(ActionMapping mapping, HttpServletRequest request) {

		// TODO Auto-generated method stub
	}

	public String getSubmit_button() {
		return submit_button;
	}

	public void setSubmit_button(String submit_button) {
		this.submit_button = submit_button;
	}

	public String getHagaki_id_H() {
		return hagaki_id_H;
	}

	public void setHagaki_id_H(String hagaki_id_H) {
		this.hagaki_id_H = hagaki_id_H;
	}

	public String getNen_H() {
		return nen_H;
	}

	public void setNen_H(String nen_H) {
		this.nen_H = nen_H;
	}

	public String getToukyu_id_H() {
		return toukyu_id_H;
	}

	public void setToukyu_id_H(String toukyu_id_H) {
		this.toukyu_id_H = toukyu_id_H;
	}

}

⌨️ 快捷键说明

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