Examples of PriceIncrease


Examples of org.landal.mvcsample.service.PriceIncrease

  public boolean supports(Class clazz) {
    return PriceIncrease.class.equals(clazz);
  }

  public void validate(Object obj, Errors errors) {
    PriceIncrease pi = (PriceIncrease) obj;
    if (pi == null) {
      errors.rejectValue("percentage", "error.not-specified", null,
          "Value required.");
    } else {
      logger.info("Validating with " + pi + ": " + pi.getPercentage());
      if (pi.getPercentage() > maxPercentage) {
        errors.rejectValue("percentage", "error.too-high",
            new Object[] { new Integer(maxPercentage) },
            "Value too high.");
      }
      if (pi.getPercentage() <= minPercentage) {
        errors.rejectValue("percentage", "error.too-low",
            new Object[] { new Integer(minPercentage) },
            "Value too low.");
      }
    }
View Full Code Here

Examples of org.landal.mvcsample.service.PriceIncrease

    return new ModelAndView(new RedirectView(getSuccessView()));
  }

  protected Object formBackingObject(HttpServletRequest request)
      throws ServletException {
    PriceIncrease priceIncrease = new PriceIncrease();
    priceIncrease.setPercentage(20);
    return priceIncrease;
  }
View Full Code Here

Examples of springapp.service.PriceIncrease

    return new ModelAndView(new RedirectView(getSuccessView()));
  }

  protected Object formBackingObject(HttpServletRequest request)
      throws ServletException {
    PriceIncrease priceIncrease = new PriceIncrease();
    priceIncrease.setPercentage(20);
    return priceIncrease;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.