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

📄 adminloginform.java

📁 一个学习了解struts的例子。需要组件:struts1.2 jsp2.0 servlet2.4 jdk1.5 tomcat5.5 jstl1.1
💻 JAVA
字号:
package com.gton.formbean.admin;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionMessage;

public class AdminLoginForm extends ActionForm {
    private String admin_Name;
    private String admin_Pwd;
    public String getAdmin_Name() {
        return admin_Name;
    }

    public void setAdmin_Name(String admin_Name) {
        this.admin_Name = admin_Name;
    }

    public void setAdmin_Pwd(String admin_Pwd) {
        this.admin_Pwd = admin_Pwd;
    }

    public String getAdmin_Pwd() {
        return admin_Pwd;
    }

    public ActionErrors validate(ActionMapping actionMapping,
                                 HttpServletRequest httpServletRequest) {
        ActionErrors err = new ActionErrors();
        if (this.getAdmin_Name() == null ||this.getAdmin_Name().length()<1) {
            err.add("nameerr", new ActionMessage("err.user.login.namenullerr"));
        }
        if (this.getAdmin_Pwd() == null||this.getAdmin_Pwd().length()<1) {
            err.add("pwderr", new ActionMessage("err.user.login.pwdnullerr"));
        }
        return err;
    }

    public void reset(ActionMapping actionMapping,
                      HttpServletRequest servletRequest) {
    }
}

⌨️ 快捷键说明

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