@Override
	public void validate(Object target, Errors error) {
		// TODO Auto-generated method stub
		Contact contact=(Contact) target;
		String firstName=contact.getFirstName();
		String lastName=contact.getLastName();
		
		if(firstName==null || firstName.trim().equals("")){
			ValidationUtils.rejectIfEmpty(error, "firstName", "NotEmpty");
		}
		else{
			if(firstName.length()<2 || firstName.length()>50)
				error.rejectValue("firstName", "Size.firstName");
		}
		
		//validation for lastName
		if(lastName==null || lastName.trim().equals("")){
			ValidationUtils.rejectIfEmptyOrWhitespace(error, "lastName", "NotEmpty");
		}
		else{
			if(lastName.length()<2 || lastName.length()>50)
				error.rejectValue("lastName", "Size.firstName");
		}
		
		//validating contactNumber
	}