package untitled3;

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.ActionError;
public class addActionForm
    extends ActionForm {
  private Float num1;
  private Float num2;
  public Float getNum1() {
    return num1;
  }

  public void setNum1(Float num1) {
    this.num1 = num1;
  }

  public void setNum2(Float num2) {
    this.num2 = num2;
  }

  public Float getNum2() {
    return num2;
  }

  public ActionErrors validate(ActionMapping actionMapping,
                               HttpServletRequest httpServletRequest) {
    ActionErrors errors=new ActionErrors();
      if((num1==null)||(num1.equals("")))
      {
errors.add(ActionErrors.GLOBAL_MESSAGE,new ActionError("error.num1"));
}
      if((num2==null)||(num2.equals("")))
      {
errors.add(ActionErrors.GLOBAL_MESSAGE,new ActionError("error.num2"));
}
      return errors;
  }

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