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

📄 adminitemform.java

📁 我的智囊团,学习三种框架很好的源码包含分页.
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package org.lxh.myzngt.struts.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;

/**
 * MyEclipse Struts Creation date: 07-03-2007
 * 
 * XDoclet definition:
 * 
 * @struts.form name="adminitemForm"
 */
public class AdminitemForm extends ActionForm {
	/*
	 * Generated fields
	 */

	/** itemcode property */
	private String itemcode;

	/** itemname property */
	private String itemname;

	/** itemid property */
	private String itemid;

	private int type;

	// 1:表示增加
	// 2:表示更新
	/*
	 * Generated Methods
	 */

	/**
	 * Method validate
	 * 
	 * @param mapping
	 * @param request
	 * @return ActionErrors
	 */
	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {
		ActionErrors errors = new ActionErrors();
		if (type == 1) {
			if (this.itemname == null || "".equals(this.itemname)) {
				errors.add("itemname", new ActionMessage("item.itemname.null"));
			}
			if (this.itemcode == null || "".equals(this.itemcode)) {
				errors.add("itemcode", new ActionMessage("item.itemcode.null"));
			} else {
				if (this.itemcode.matches("\\d*")) {
					errors.add("itemcode", new ActionMessage(
							"item.itemcode.error"));
				}
			}
		}
		if (type == 2) {
			if (this.itemname == null || "".equals(this.itemname)) {
				errors.add("itemname", new ActionMessage("item.itemname.null"));
			}
			if (this.itemcode == null || "".equals(this.itemcode)) {
				errors.add("itemcode", new ActionMessage("item.itemcode.null"));
			} else {
				if (this.itemcode.matches("\\d*")) {
					errors.add("itemcode", new ActionMessage(
							"item.itemcode.error"));
				}
			}
		}
		return errors;
	}

	/**
	 * Method reset
	 * 
	 * @param mapping
	 * @param request
	 */
	public void reset(ActionMapping mapping, HttpServletRequest request) {
		// TODO Auto-generated method stub
	}

	/**
	 * Returns the itemcode.
	 * 
	 * @return String
	 */
	public String getItemcode() {
		return itemcode;
	}

	/**
	 * Set the itemcode.
	 * 
	 * @param itemcode
	 *            The itemcode to set
	 */
	public void setItemcode(String itemcode) {
		this.itemcode = itemcode;
	}

	/**
	 * Returns the itemname.
	 * 
	 * @return String
	 */
	public String getItemname() {
		return itemname;
	}

	/**
	 * Set the itemname.
	 * 
	 * @param itemname
	 *            The itemname to set
	 */
	public void setItemname(String itemname) {
		this.itemname = itemname;
	}

	/**
	 * Returns the itemid.
	 * 
	 * @return String
	 */
	public String getItemid() {
		return itemid;
	}

	/**
	 * Set the itemid.
	 * 
	 * @param itemid
	 *            The itemid to set
	 */
	public void setItemid(String itemid) {
		this.itemid = itemid;
	}
}

⌨️ 快捷键说明

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