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

📄 regform.java

📁 反ajax原代码
💻 JAVA
字号:
// Decompiled by Jad v1.5.7g. Copyright 2000 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/SiliconValley/Bridge/8617/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi 
// Source File Name:   RegForm.java

package com.laoer.bbscs.web.form;

import com.laoer.bbscs.sys.Constant;
import com.laoer.bbscs.sys.SysUtil;
import com.laoer.comm.util.Util;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.*;

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;

    public RegForm()
    {
    }

    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 + -