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

📄 loginform.java

📁 openblog是一个博客管理系统
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package org.openblog.struts.login.form;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

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-26-2008
 * 
 * XDoclet definition:
 * @struts.form name="userLoginForm"
 */
public class LoginForm extends ActionForm {
	/*
	 * Generated fields
	 */

	/** password property */
	private String password;

	/** userName property */
	private String userName;

	/** checkNum property */
	private String checkNum;

	/*
	 * Generated Methods
	 */

	/** 
	 * Method validate
	 * @param mapping
	 * @param request
	 * @return ActionErrors
	 */
	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {

		HttpSession session=request.getSession();
		ActionErrors errors=new ActionErrors();
		if(!this.checkNum.equals((String)session.getAttribute("checkNum")))
		{
			errors.add("checkNum", new ActionMessage("login.CheckNumNull"));
			this.checkNum="";
		}
		if(this.userName==null||"".equals(this.userName)||this.password==null||"".equals(this.password))
		{
			errors.add("userName",new ActionMessage("login.UserNameNull"));
		}
		return errors;
	}

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

	/** 
	 * Returns the password.
	 * @return String
	 */
	public String getPassword() {
		return password;
	}

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

	/** 
	 * Returns the userName.
	 * @return String
	 */
	public String getUserName() {
		return userName;
	}

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

	/** 
	 * Returns the checkNum.
	 * @return String
	 */
	public String getCheckNum() {
		return checkNum;
	}

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

⌨️ 快捷键说明

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