package actionForm;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionMessage;

public class DeletePhoneNumberValidationForm extends ActionForm {
	private static final long serialVersionUID = 1L;
	
	private long id = 0;   
	private String phoneNumber 	= null;
	private String phoneKind 	= null;
	
	public long getId() {
		return id;
	}
	
	public void setId(long id) {
		this.id = id;
	}
	
	public String getPhoneNumber() {
		return phoneNumber;
	}
	
	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}
	
	public String getPhoneKind() {
		return phoneKind;
	}
	
	public void setPhoneKind(String phoneKind) {
		this.phoneKind = phoneKind;
	}
	
	public void reset(ActionMapping mapping, HttpServletRequest request) {
	  	this.id = 0;
	    this.phoneNumber	= null;
	    this.phoneKind 		= null;
	}

	public ActionErrors validate(
		ActionMapping mapping, HttpServletRequest request ) {
		ActionErrors errors = new ActionErrors();
		      
		if( getPhoneNumber() == null || getPhoneNumber().length() < 2 &&
				getPhoneKind() == null || getPhoneKind().length() < 1) {
			errors.add("phonenumber ", new ActionMessage("phonenumber.delete.error"));
		}
		
		return errors;
	}
}

@@ -1141,17 +1141,17 @@
   %0A%09%09if(
- 
+(
 getPhone
@@ -1203,16 +1203,17 @@
  %3C 2
+)
  &&%0A%09%09%09%09
 getP
@@ -1208,16 +1208,17 @@
  &&%0A%09%09%09%09
+(
 getPhone
@@ -1263,16 +1263,17 @@
 h() %3C 1)
+)
  %7B%0A%09%09%09er

Fix bug with Delete phone number validation