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

📄 calcform.java

📁 计算器源代码!!功能基本实现
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package com.important.struts.form;

import javax.servlet.ServletRequest;
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: 04-12-2008
 * 
 * XDoclet definition:
 * @struts.form name="calcForm"
 */
public class CalcForm extends ActionForm {
	/*
	 * Generated fields
	 */

	/** v1 property */
	private String v1;

	/** type property */
	private String type;

	/** v2 property */
	private String v2;
	private int result;

	/*
	 * Generated Methods
	 */

	public int getResult() {
		return result;
	}

	public void setResult(int result) {
		this.result = result;
	}

	/** 
	 * Method validate
	 * @param mapping
	 * @param request
	 * @return ActionErrors
	 */
	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {
		// TODO Auto-generated method stub
		ActionErrors errors = new ActionErrors();
		if (v1==null||(v1.trim().equals(""))) {
		     ActionMessage error = new ActionMessage("error.nov1");
		     errors.add("v1",error);
		     
		}
		if (v2==null||(v2.trim().equals(""))) {
		     ActionMessage error = new ActionMessage("error.nov2");
		     errors.add("v2",error);
		}
		return errors;
	}

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

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

	/** 
	 * Returns the v1.
	 * @return String
	 */
	public String getV1() {
		return v1;
	}

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

	/** 
	 * Returns the type.
	 * @return String
	 */
	public String getType() {
		return type;
	}

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

	/** 
	 * Returns the v2.
	 * @return String
	 */
	public String getV2() {
		return v2;
	}

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

⌨️ 快捷键说明

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