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

📄 registform.java

📁 一个java写的网上购物系统
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package com.hb.myshop.struts.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: 10-06-2008
 * 
 * XDoclet definition:
 * @struts.form name="registForm"
 */
public class RegistForm extends ActionForm {
	/*
	 * Generated fields
	 */

	/** sex property */
	private String sex="boy";

	/** age property */
	private String age;
     private String remark;
	/** password2 property */
	private String password2;

	/** account property */
	private String account;

	/** address property */
	private String phone;

	/** email property */
	private String email;

	/** name property */
	private String name;

	/** password1 property */
	private String password1;

	/*
	 * 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(account.length()==0)
//		{
//			ActionMessage error=new ActionMessage("error.account.null","account");
//			errors.add("account",error);
//		}
//		else if(account.length()<4||account.length()>20)
//		{
//			ActionMessage error=new ActionMessage("error.account.out","account");
//			errors.add("account",error);
//		}
//			
//		
//		if(password1.length()==0)
//		{
//			ActionMessage error=new ActionMessage("error.password1.null","password1");
//			errors.add("password1",error);
//		}
//		
//		else if(password1.length()<4||password1.length()>20)
//		{
//			ActionMessage error=new ActionMessage("error.password1.out","password1");
//			errors.add("password1",error);
//		}
//		if(password2.length()==0)
//		{
//			ActionMessage error=new ActionMessage("error.password2.null","password2");
//			errors.add("password2",error);
//		}
//		else if(!password2.equals(password1))
//		{
//			ActionMessage error=new ActionMessage("error.password2.ns","password2");
//			errors.add("password2",error);
//			
//		}
//		if(phone.length()==0)
//		{
//			ActionMessage error=new ActionMessage("error.phone.null","phone");
//			errors.add("phone",error);
//		}
//		else if(phone.length()==11)
//		{
//			if(phone.matches("//d"));
//			{
//			  if(!phone.substring(0, 2).equals("13"))
//			  {
//				  ActionMessage error=new ActionMessage("error.phone.bf","phone");
//					errors.add("phone",error);
//			  }
//			  
//			}
//			
//		}
//		else
//		  {
//			  ActionMessage error=new ActionMessage("error.phone.bf","phone");
//				errors.add("phone",error);
//		  }
//			
//		if(remark.length()==0)
//		{
//			ActionMessage error=new ActionMessage("error.mark.null","mark");
//			errors.add("mark",error);
//		}
//		else if(remark.equals(session.getAttribute("rand")))
//		{
//			ActionMessage error=new ActionMessage("error.mark.ok","mark");
//			errors.add("mark",error);
//		}
//		else
//		{
//			ActionMessage error=new ActionMessage("error.mark.ns","mark");
//			errors.add("mark",error);
//		}
//			
	return null;
	}

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

	/** 
	 * Returns the sex.
	 * @return String
	 */
	public String getSex() {
		return sex;
	}

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

	/** 
	 * Returns the age.
	 * @return String
	 */
	public String getAge() {
		return age;
	}

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

	/** 
	 * Returns the password2.
	 * @return String
	 */
	public String getPassword2() {
		return password2;
	}

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

	/** 
	 * Returns the account.
	 * @return String
	 */
	public String getAccount() {
		return account;
	}

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

	

	/** 
	 * 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 password1.
	 * @return String
	 */
	public String getPassword1() {
		return password1;
	}

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

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
}

⌨️ 快捷键说明

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