📄 addadminform.java
字号:
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package edu.neu.sspp.struts.form.admin;
import java.io.IOException;
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-14-2005
*
* XDoclet definition:
* @struts.form name="addAdminForm"
*/
public class AddAdminForm extends ActionForm {
/*
* Generated fields
*/
/** email property */
private String email;
/** name property */
private String name;
/** rePassword property */
private String rePassword;
/** password property */
private String password;
/*
* Generated Methods
*/
/**
* Method validate
* @param mapping
* @param request
* @return ActionErrors
*/
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
// TODO Auto-generated method stub
ActionErrors error = new ActionErrors();
if(name == null || name.equals("")) {
error.add("name", new ActionMessage("error.register.userName.null"));
password = "";
rePassword = "";
}
if(password == null || password.equals("")) {
error.add("password", new ActionMessage("error.register.password.null"));
password = "";
rePassword = "";
}
if(!password.equals(rePassword)) {
error.add("rePassword", new ActionMessage("error.register.rePassword.wrong"));
}
try {
convertToUTF();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return error;
}
/**
* Method reset
* @param mapping
* @param request
*/
public void reset(ActionMapping mapping, HttpServletRequest request) {
// TODO Auto-generated method stub
}
/**
* 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 rePassword.
* @return String
*/
public String getRePassword() {
return rePassword;
}
/**
* Set the rePassword.
* @param rePassword The rePassword to set
*/
public void setRePassword(String rePassword) {
this.rePassword = rePassword;
}
/**
* 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;
}
private void convertToUTF() throws IOException {
name = new String(name.getBytes("ISO-8859-1"), "UTF-8");
password = new String(password.getBytes("ISO-8859-1"), "UTF-8");
email = new String(email.getBytes("ISO-8859-1"), "UTF-8");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -