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

📄 updatepasswdform.java

📁 酒店管理系统 用sh编写的酒店管理系统 毕业设计用的
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package com.chen.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;

import com.chen.interFace.admininfo;
import com.chen.interFace.InterFaceDAO.adminDAOImpl;

/** 
 * MyEclipse Struts
 * Creation date: 10-29-2008
 * 
 * XDoclet definition:
 * @struts.form name="updatepasswdForm"
 */
public class UpdatepasswdForm extends ActionForm {
	/*
	 * Generated fields
	 */

	/** newpassword property */
	private String newpassword;

	/** adminname property */
	private String adminname;

	/** renewpassword property */
	private String renewpassword;

	/** oldpassword property */
	private String oldpassword;

	/*
	 * Generated Methods
	 */

	/** 
	 * Method validate
	 * @param mapping
	 * @param request
	 * @return ActionErrors
	 */
	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {
		ActionErrors errors = new ActionErrors();
		admininfo admin = new adminDAOImpl();
		
		if("".equals(this.adminname)){
			errors.clear();
			errors.add("adminname", new ActionMessage("nameisempty"));
			return errors;
		}
		if("".equals(this.oldpassword)){
			errors.clear();
			errors.add("oldpassword", new ActionMessage("passwordisempty"));
			return errors;
		}
		if("".equals(this.newpassword)){
			errors.clear();
			errors.add("newpassword", new ActionMessage("passwordisempty"));
			return errors;
		}
		if("".equals(this.renewpassword)){
			errors.clear();
			errors.add("renewpassword", new ActionMessage("passwordisempty"));
			return errors;
		}
		
		if(!((this.newpassword).equals(this.renewpassword))){
			errors.clear();
			errors.add("renewpassword", new ActionMessage("twonewpasswordnotsame"));
			return errors;
		}
		
		if(!admin.validateAdmin(this.adminname, this.oldpassword)){
			errors.clear();
			errors.add("adminname",new ActionMessage("idorpasswordisfalse"));
			return errors;
		}
		return null;
	}

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

	/** 
	 * Returns the newpassword.
	 * @return String
	 */
	public String getNewpassword() {
		return newpassword;
	}

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

	/** 
	 * Returns the adminname.
	 * @return String
	 */
	public String getAdminname() {
		return adminname;
	}

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

	/** 
	 * Returns the renewpassword.
	 * @return String
	 */
	public String getRenewpassword() {
		return renewpassword;
	}

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

	/** 
	 * Returns the oldpassword.
	 * @return String
	 */
	public String getOldpassword() {
		return oldpassword;
	}

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

⌨️ 快捷键说明

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