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

📄 regform.java

📁 基于j2ee中structs写软件
💻 JAVA
字号:
/*
 * Generated by MyEclipse Struts
 * Template path: templates/java/JavaClass.vtl
 */
package com.yourcompany.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;

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

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/** userName property */
	private String userName;

	/** userEmail property */
	private String userEmail;

	/** userId property */
	private String userId;

	/** userSex property */
	private String userSex;

	/** userPhone property */
	private String userPhone;

	/** userPassword property */
	private String userPassword;

	/** userCard property */
	private String userCard;

	/** userAddress property */
	private String userAddress;

	/*
	 * Generated Methods
	 */

	/** 
	 * Method validate
	 * @param mapping
	 * @param request
	 * @return ActionErrors
	 */
	public ActionErrors validate(ActionMapping mapping,
			HttpServletRequest request) {
		// TODO Auto-generated method stub
		ActionErrors errors=new ActionErrors();
		if(userId.length()==0||userId.length()<8){
			if(userId.length()==0)
				errors.add("userId", new ActionMessage("error.id.required"));
			else
				errors.add("userId", new ActionMessage("error.id.minlength"));
		}
		if(userPassword.length()==0||userPassword.length()<6){
			if(userPassword.length()==0)
				errors.add("userPassword", new ActionMessage("error.password.required"));
			else 
				errors.add("userPassword", new ActionMessage("error.password.minlength"));
		}
		if(userCard.length()==0){
			errors.add("userCard", new ActionMessage("error.card.required"));
		}
		if(userName.length()==0){
			errors.add("userName", new ActionMessage("error.name.required"));
		}
		if(userSex==null){
			errors.add("userSex", new ActionMessage("error.sex.required"));
		}
		if(userPhone.length()==0){
			errors.add("userPhone", new ActionMessage("error.phone.required"));
		}
		if(userEmail.length()==0){
			errors.add("userEmail", new ActionMessage("error.email.required"));
		}
		if(userAddress.length()==0){
			errors.add("userAddress", new ActionMessage("error.address.required"));
		}
		return errors;
	}

	/** 
	 * Method reset
	 * @param mapping
	 * @param request
	 */
	public void reset(ActionMapping mapping, HttpServletRequest request) {
		// TODO Auto-generated method stub
		userId="";
		userPassword="";
		userCard="";
		userName="";
		userSex=null;
		userPhone="";
		userEmail="";
		userAddress="";
	}

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

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

	/** 
	 * Returns the userId.
	 * @return String
	 */
	public String getUserId() {
		return userId;
	}

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

	/** 
	 * Returns the userSex.
	 * @return String
	 */
	public String getUserSex() {
		return userSex;
	}

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

	/** 
	 * Returns the userPhone.
	 * @return String
	 */
	public String getUserPhone() {
		return userPhone;
	}

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

	/** 
	 * Returns the userPassword.
	 * @return String
	 */
	public String getUserPassword() {
		return userPassword;
	}

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

	/** 
	 * Returns the userCard.
	 * @return String
	 */
	public String getUserCard() {
		return userCard;
	}

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

	/** 
	 * Returns the userAddress.
	 * @return String
	 */
	public String getUserAddress() {
		return userAddress;
	}

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

⌨️ 快捷键说明

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