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

📄 clientmodifyform.java

📁 J2EE电子商务系统开发从入门到精通---基于Struts和Hibernate技术实现
💻 JAVA
字号:
/*
 * ClientModifyForm.java
 *
 * Created on 2006年5月19日, 下午10:55
 */

package form.store;

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

/**
 *
 * @author Administrator
 * @version
 */

public class ClientModifyForm extends org.apache.struts.action.ActionForm {
    private String name;
    private String type;
    private String address;
    private String zip;
    private String phone;
    private String fax;
    private String remarks;
    
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getZip() {
        return zip;
    }

    public void setZip(String zip) {
        this.zip = zip;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getFax() {
        return fax;
    }

    public void setFax(String fax) {
        this.fax = fax;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }
    
    public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
        ActionErrors errors = new ActionErrors();
        if (getName() == null || getName().equals("")) {
            errors.add("name", new ActionMessage("error.client.name.required"));
        }
        if (getZip() == null || getZip().equals("")) {
            errors.add("zip", new ActionMessage("error.client.zip.required"));
        }
        if (getType() == null || getType().equals("")) {
            errors.add("type", new ActionMessage("error.client.type.required"));
        }
        if (getAddress() == null || getAddress().equals("")) {
            errors.add("address", new ActionMessage("error.client.address.required"));
        }
        if (getPhone() == null || getPhone().equals("")) {
            errors.add("phone", new ActionMessage("error.client.phone.required"));
        }
        if (getFax() == null || getFax().equals("")) {
            errors.add("fax", new ActionMessage("error.client.fax.required"));
        }
        if (getRemarks() == null) {
            errors.add("remarks", new ActionMessage("error.client.remarks.required"));
        }
        return errors;
    }
}

⌨️ 快捷键说明

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