/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package users;

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

	/** checkcode property */
	private String checkcode;

	/** rpwd property */
	private String rpwd;

	/** email property */
	private String email;

	/** name property */
	private String name;

	/** pwd property */
	private String pwd;

	/*
	 * Generated Methods
	 */

	/** 
	 * Method validate
	 * @param mapping
	 * @param request
	 * @return ActionErrors
	 */
	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {
		ActionErrors errors = new ActionErrors();
		String check = (String)request.getSession().getAttribute("rand");
		if(!pwd.equals(rpwd))
		{
			errors.add("pwderr",new ActionMessage("pwderr"));
		}
		if(email.equals(""))
		{
			errors.add("mail",new ActionMessage("mail"));
		}
		if(!checkcode.equals(check))
		{
			errors.add("checkcode",new ActionMessage("checkcode"));
		}
		return errors;
	}

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

	/** 
	 * Returns the checkcode.
	 * @return String
	 */
	public String getCheckcode() {
		return checkcode;
	}

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

	/** 
	 * Returns the rpwd.
	 * @return String
	 */
	public String getRpwd() {
		return rpwd;
	}

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

	/** 
	 * Returns the email.
	 * @return String
	 */
	public String getEmail() {
		return email;
	}

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

	/** 
	 * Returns the name.
	 * @return String
	 */
	public String getName() {
		return name;
	}

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

	/** 
	 * Returns the pwd.
	 * @return String
	 */
	public String getPwd() {
		return pwd;
	}

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