📄 userform.java
字号:
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package org.lxh.myzngt.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: 06-30-2007
*
* XDoclet definition:
*
* @struts.form name="userForm"
*/
public class UserForm extends ActionForm {
/*
* Generated fields
*/
/** sex property */
private String sex = "男" ;
/** usermail property */
private String usermail;
/** userques property */
private String userques;
/** userid property */
private String userid;
/** realname property */
private String realname;
/** userans property */
private String userans;
/** userpwd property */
private String userpwd;
private String confirmpwd;
private String checkcode;
/** grade property */
private String grade;
/** integral property */
private String integral;
/** id property */
private String id;
private int type;
// 1:表示注册功能
// 2:表示登陆
// 3:表示忘记密码,确认用户是否存在
// 4:表示修改密码
/*
* Generated Methods
*/
/**
* Method validate
*
* @param mapping
* @param request
* @return ActionErrors
*/
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
ActionErrors errors = new ActionErrors();
if (type == 1) {
if (this.userid == null || "".equals(this.userid)) {
errors.add("userid", new ActionMessage("user.userid.null"));
}
if (this.userpwd == null || "".equals(this.userpwd)) {
errors.add("userpwd", new ActionMessage("user.userpwd.null"));
} else {
if (!(this.userpwd.equals(this.confirmpwd))) {
errors.add("configpwd", new ActionMessage(
"user.confirmpwd.error"));
}
}
if (this.userques == null || "".equals(this.userques)) {
errors.add("userques", new ActionMessage("user.userques.null"));
}
if (this.userans == null || "".equals(this.userans)) {
errors.add("userans", new ActionMessage("user.userans.null"));
}
if (this.checkcode == null || "".equals(this.checkcode)) {
errors.add("checkcode", new ActionMessage("checkcode.null"));
}
}
if (type == 2) {
if (this.userid == null || "".equals(this.userid)) {
errors.add("userid", new ActionMessage("user.userid.null"));
}
if (this.userpwd == null || "".equals(this.userpwd)) {
errors.add("userpwd", new ActionMessage("user.userpwd.null"));
}
if (this.checkcode == null || "".equals(this.checkcode)) {
errors.add("checkcode", new ActionMessage("checkcode.null"));
}
}
if (type == 3) {
if (this.userid == null || "".equals(this.userid)) {
errors.add("userid", new ActionMessage("user.userid.null"));
}
if (this.userques == null || "".equals(this.userques)) {
errors.add("userques", new ActionMessage("user.userques.null"));
}
if (this.userans == null || "".equals(this.userans)) {
errors.add("userans", new ActionMessage("user.userans.null"));
}
if (this.checkcode == null || "".equals(this.checkcode)) {
errors.add("checkcode", new ActionMessage("checkcode.null"));
}
}
if (type == 4) {
if (this.userid == null || "".equals(this.userid)) {
errors.add("userid", new ActionMessage("user.userid.null"));
}
if (this.userpwd == null || "".equals(this.userpwd)) {
errors.add("userpwd", new ActionMessage("user.userpwd.null"));
} else {
if (!(this.userpwd.equals(this.confirmpwd))) {
errors.add("configpwd", new ActionMessage(
"user.confirmpwd.error"));
}
}
if (this.checkcode == null || "".equals(this.checkcode)) {
errors.add("checkcode", new ActionMessage("checkcode.null"));
}
}
return errors;
}
/**
* Method reset
*
* @param mapping
* @param request
*/
public void reset(ActionMapping mapping, HttpServletRequest request) {
// TODO Auto-generated method stub
this.checkcode = "" ;
}
/**
* 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 usermail.
*
* @return String
*/
public String getUsermail() {
return usermail;
}
/**
* Set the usermail.
*
* @param usermail
* The usermail to set
*/
public void setUsermail(String usermail) {
this.usermail = usermail;
}
/**
* Returns the userques.
*
* @return String
*/
public String getUserques() {
return userques;
}
/**
* Set the userques.
*
* @param userques
* The userques to set
*/
public void setUserques(String userques) {
this.userques = userques;
}
/**
* 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 realname.
*
* @return String
*/
public String getRealname() {
return realname;
}
/**
* Set the realname.
*
* @param realname
* The realname to set
*/
public void setRealname(String realname) {
this.realname = realname;
}
/**
* Returns the userans.
*
* @return String
*/
public String getUserans() {
return userans;
}
/**
* Set the userans.
*
* @param userans
* The userans to set
*/
public void setUserans(String userans) {
this.userans = userans;
}
/**
* Returns the userpwd.
*
* @return String
*/
public String getUserpwd() {
return userpwd;
}
/**
* Set the userpwd.
*
* @param userpwd
* The userpwd to set
*/
public void setUserpwd(String userpwd) {
this.userpwd = userpwd;
}
/**
* Returns the grade.
*
* @return String
*/
public String getGrade() {
return grade;
}
/**
* Set the grade.
*
* @param grade
* The grade to set
*/
public void setGrade(String grade) {
this.grade = grade;
}
/**
* Returns the integral.
*
* @return String
*/
public String getIntegral() {
return integral;
}
/**
* Set the integral.
*
* @param integral
* The integral to set
*/
public void setIntegral(String integral) {
this.integral = integral;
}
/**
* Returns the id.
*
* @return String
*/
public String getId() {
return id;
}
/**
* Set the id.
*
* @param id
* The id to set
*/
public void setId(String id) {
this.id = id;
}
public String getConfirmpwd() {
return confirmpwd;
}
public void setConfirmpwd(String confirmpwd) {
this.confirmpwd = confirmpwd;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public String getCheckcode() {
return checkcode;
}
public void setCheckcode(String checkcode) {
this.checkcode = checkcode;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -