📄 regform.java
字号:
package com.laoer.bbscs.web.form;
import org.apache.struts.action.*;
import javax.servlet.http.*;
import com.laoer.bbscs.sys.*;
import com.laoer.comm.util.*;
/**
* <p>Title: TianYi BBS</p>
* <p>Description: TianYi BBS System</p>
* <p>Copyright: Copyright (c) 2004</p>
* <p>Company: LAOER.COM/TIANYISOFT.NET</p>
* @author laoer
* @version 6.0
*/
public class RegForm
extends ActionForm {
private String action;
private String answer;
private String brief;
private String email;
private short forumPerNum;
private String homePage;
private String icqNo;
private String msn;
private String nickname;
private String oicqNo;
private String passwd;
private short postPerNum;
private String question;
private String repasswd;
private short sex;
private String timeZone;
private String userFrom;
private String username;
private String yahoo;
//加的东东
private String rfolk;
private String rphoto;
private String rphotos;
private String rhandset;
private String raddreess;
private String province;
private String city;
private String citys;
private String ridentityCard;
private String rclient;
private String rOperation;
private String coteId;
private String rcardees;
private String year;
private String month;
private String day;
private String marriage;
private String colling;
private String kind;
private String duty;
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getCitys() {
return citys;
}
public void setCitys(String citys) {
this.citys = citys;
}
public String getColling() {
return colling;
}
public void setColling(String colling) {
this.colling = colling;
}
public String getCoteId() {
return coteId;
}
public void setCoteId(String coteId) {
this.coteId = coteId;
}
public String getDay() {
return day;
}
public void setDay(String day) {
this.day = day;
}
public String getDuty() {
return duty;
}
public void setDuty(String duty) {
this.duty = duty;
}
public String getKind() {
return kind;
}
public void setKind(String kind) {
this.kind = kind;
}
public String getMarriage() {
return marriage;
}
public void setMarriage(String marriage) {
this.marriage = marriage;
}
public String getMonth() {
return month;
}
public void setMonth(String month) {
this.month = month;
}
public String getProvince() {
return province;
}
public void setProvince(String province) {
this.province = province;
}
public String getRaddreess() {
return raddreess;
}
public void setRaddreess(String raddreess) {
this.raddreess = raddreess;
}
public String getRcardees() {
return rcardees;
}
public void setRcardees(String rcardees) {
this.rcardees = rcardees;
}
public String getRclient() {
return rclient;
}
public void setRclient(String rclient) {
this.rclient = rclient;
}
public String getRfolk() {
return rfolk;
}
public void setRfolk(String rfolk) {
this.rfolk = rfolk;
}
public String getRhandset() {
return rhandset;
}
public void setRhandset(String rhandset) {
this.rhandset = rhandset;
}
public String getRidentityCard() {
return ridentityCard;
}
public void setRidentityCard(String ridentityCard) {
this.ridentityCard = ridentityCard;
}
public String getROperation() {
return rOperation;
}
public void setROperation(String operation) {
rOperation = operation;
}
public String getRphoto() {
return rphoto;
}
public void setRphoto(String rphoto) {
this.rphoto = rphoto;
}
public String getRphotos() {
return rphotos;
}
public void setRphotos(String rphotos) {
this.rphotos = rphotos;
}
public String getYear() {
return year;
}
public void setYear(String year) {
this.year = year;
}
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public String getAnswer() {
return answer;
}
public void setAnswer(String answer) {
this.answer = answer;
}
public String getBrief() {
return brief;
}
public void setBrief(String brief) {
this.brief = brief;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public short getForumPerNum() {
return forumPerNum;
}
public void setForumPerNum(short forumPerNum) {
this.forumPerNum = forumPerNum;
}
public String getHomePage() {
return homePage;
}
public void setHomePage(String homePage) {
this.homePage = homePage;
}
public String getIcqNo() {
return icqNo;
}
public void setIcqNo(String icqNo) {
this.icqNo = icqNo;
}
public String getMsn() {
return msn;
}
public void setMsn(String msn) {
this.msn = msn;
}
public String getNickname() {
return nickname;
}
public void setNickname(String nickname) {
this.nickname = nickname;
}
public String getOicqNo() {
return oicqNo;
}
public void setOicqNo(String oicqNo) {
this.oicqNo = oicqNo;
}
public String getPasswd() {
return passwd;
}
public void setPasswd(String passwd) {
this.passwd = passwd;
}
public short getPostPerNum() {
return postPerNum;
}
public void setPostPerNum(short postPerNum) {
this.postPerNum = postPerNum;
}
public String getQuestion() {
return question;
}
public void setQuestion(String question) {
this.question = question;
}
public String getRepasswd() {
return repasswd;
}
public void setRepasswd(String repasswd) {
this.repasswd = repasswd;
}
public short getSex() {
return sex;
}
public void setSex(short sex) {
this.sex = sex;
}
public String getTimeZone() {
return timeZone;
}
public void setTimeZone(String timeZone) {
this.timeZone = timeZone;
}
public String getUserFrom() {
return userFrom;
}
public void setUserFrom(String userFrom) {
this.userFrom = userFrom;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getYahoo() {
return yahoo;
}
public void setYahoo(String yahoo) {
this.yahoo = yahoo;
}
public ActionErrors validate(ActionMapping actionMapping,
HttpServletRequest httpServletRequest) {
ActionErrors errors = new ActionErrors();
if (action == null || action.length() == 0) {
action = "add";
}
if (action.equals("new")) {
if (username == null || username.length() == 0 || nickname == null ||
nickname.trim().length() == 0 || passwd == null ||
passwd.length() == 0 || question == null ||
question.trim().length() == 0 || answer == null ||
answer.trim().length() == 0) {
errors.add("error.nullerror", new ActionError("error.nullerror"));
}
username = username.trim();
nickname = nickname.trim();
question = question.trim();
answer = answer.trim();
if (!Util.validateUserName(username)) {
errors.add("error.reg.name0", new ActionError("error.reg.name0"));
}
if (SysUtil.isBadNickName(nickname)) {
errors.add("error.reg.badnickname",
new ActionError("error.reg.badnickname"));
}
username = username.toLowerCase();
if (SysUtil.isNotAllowRegName(username)) {
errors.add("error.reg.badusername",
new ActionError("error.reg.badusername", username));
}
if (username.length() < 3 || username.length() > 20) {
errors.add("error.reg.username.toolong",
new ActionError("error.reg.username.toolong"));
}
if (SysUtil.getStrLength(nickname, Constant.CHARSET) > 60) {
errors.add("error.reg.nickname.toolong",
new ActionError("error.reg.nickname.toolong"));
}
if (passwd.length() < 3 || passwd.length() > 20) {
errors.add("error.reg.passwd.toolong",
new ActionError("error.reg.passwd.toolong"));
}
if (!passwd.equals(repasswd)) {
errors.add("error.reg.passwd.notsame",
new ActionError("error.reg.passwd.notsame"));
}
if (SysUtil.getStrLength(question, Constant.CHARSET) > 150) {
errors.add("error.reg.question.toolong",
new ActionError("error.reg.question.toolong"));
}
if (SysUtil.getStrLength(answer, Constant.CHARSET) > 150) {
errors.add("error.reg.answer.toolong",
new ActionError("error.reg.answer.toolong"));
}
if (userFrom == null) {
userFrom = "";
}
if (homePage == null) {
homePage = "";
}
if (oicqNo == null) {
oicqNo = "";
}
if (icqNo == null) {
icqNo = "";
}
if (msn == null) {
msn = "";
}
if (yahoo == null) {
yahoo = "";
}
if (brief == null) {
brief = "";
}
}
return errors;
}
public void reset(ActionMapping actionMapping,
HttpServletRequest httpServletRequest) {
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -