【Java开源代码栏目提醒】:网学会员在Java开源代码频道为大家收集整理了ClientModifyForm.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;
}
}
上一篇:
ClientModifyAction.java
下一篇:
首页轮播3.jpg