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

📄 loginform.java

📁 基于J2EE的办公自动化系统。实现流程定义流程办理等。运用了hibernate+struts+spring框架综合运用的系统。
💻 JAVA
字号:
//Created by MyEclipse Struts
// XSL source (default): platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_4.1.0/xslt/JavaClass.xsl

package com.oa.module.login;

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: 01-17-2008
 * 
 * XDoclet definition:
 * @struts.form name="logiForm"
 */
public class LoginForm extends ActionForm {

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

	/** rand property */
	private String rand;

	/** upwd property */
	private String upwd;

	/** uname property */
	private String uname;
	
	private String method;

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

	/** 
	 * Method validate
	 * @param mapping
	 * @param request
	 * @return ActionErrors
	 */
	public ActionErrors validate(
		ActionMapping mapping,
		HttpServletRequest request) {
		ActionErrors errors = new ActionErrors();
		if (method != null && method.equals("login")) {
			
			if(uname==null||uname.trim().equals("")){
				ActionMessage message = new ActionMessage("用户名不能为空!",false);
				errors.add("uname",message);
			}
			if(upwd==null||upwd.trim().equals("")){
				ActionMessage message = new ActionMessage("密码不能为空!",false);
				errors.add("upwd",message);
			}
			if(rand==null||rand.trim().equals("")){
				ActionMessage message = new ActionMessage("验证码不能为空!",false);
				errors.add("rand",message);
			}
		}
		return errors;
	}

	/** 
	 * Method reset
	 * @param mapping
	 * @param request
	 */
	public void reset(ActionMapping mapping, HttpServletRequest request) {
		this.method = "login";
		// TODO Auto-generated method stub
	}

	/** 
	 * Returns the rand.
	 * @return String
	 */
	public String getRand() {
		return rand;
	}

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

	/** 
	 * Returns the upwd.
	 * @return String
	 */
	public String getUpwd() {
		return upwd;
	}

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

	/** 
	 * Returns the uname.
	 * @return String
	 */
	public String getUname() {
		return uname;
	}

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

	public String getMethod() {
		return method;
	}

	public void setMethod(String method) {
		this.method = method;
	}

}

⌨️ 快捷键说明

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