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

📄 registerform.java

📁 在eclipse平台下写的
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package com.internetshop.struts.form;

import java.io.UnsupportedEncodingException;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;

/** 
 * MyEclipse Struts
 * Creation date: 04-22-2008
 * 
 * XDoclet definition:
 * @struts.form name="registryForm"
 */
@SuppressWarnings("serial")
public class RegisterForm extends ActionForm {
	/*
	 * Generated fields
	 */

	/** password property */
	private String password;

	/** passwordAnswer property */
	private String passwordAnswer;

	/** userName property */
	private String userName;

	/** confirmPassword property */
	private String confirmPassword;

	/** email property */
	private String email;

	/** trueName property */
	private String trueName;

	/** passwordQuestion property */
	private String passwordQuestion;

	/*
	 * Generated Methods
	 */

	/** 
	 * Method validate
	 * @param mapping
	 * @param request
	 * @return ActionErrors
	 */
	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) 
	{
		ActionErrors errors = new ActionErrors();
		CheckClass check = new CheckClass();
		if(!check.checkUserNameError(userName))
		{
			errors.add("userName", new ActionError("userName.is.not.correct"));
			return errors;
		}
		if(!check.checkEmailError(email))
		{
			errors.add("email", new ActionError("email.is.not.correct"));
			return errors;
		}
		if(!check.checkPasswordError(password))
		{
			errors.add("password", new ActionError("password.is.not.correct"));
			return errors;
		}
		if(confirmPassword==null ||!confirmPassword.equals(password))
		{
			errors.add("confirmPassword", new ActionError("confirmPassword.is.not.correct"));
			return errors;
		}
		
		return errors;
	}

	/** 
	 * Method reset
	 * @param mapping
	 * @param request
	 */
	public void reset(ActionMapping mapping, HttpServletRequest request) {
		// TODO Auto-generated method stub
		try {
			request.setCharacterEncoding("GB2312");
			password=null;
			passwordAnswer=null;
			userName=null;
			confirmPassword=null;
			email=null;
			trueName=null;
			passwordQuestion=null;
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	/** 
	 * 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.trim();
	}

	/** 
	 * Returns the passwordAnswer.
	 * @return String
	 */
	public String getPasswordAnswer() {
		return passwordAnswer;
	}

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

	/** 
	 * 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.trim();
	}

	/** 
	 * Returns the confirmPassword.
	 * @return String
	 */
	public String getConfirmPassword() {
		return confirmPassword;
	}

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

	/** 
	 * 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.trim();
	}

	/** 
	 * Returns the trueName.
	 * @return String
	 */
	public String getTrueName() {
		return trueName;
	}

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

	/** 
	 * Returns the passwordQuestion.
	 * @return String
	 */
	public String getPasswordQuestion() {
		return passwordQuestion;
	}

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

⌨️ 快捷键说明

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