Examples of PetValidator


Examples of org.springframework.samples.petclinic.validation.PetValidator

    return "petForm";
  }

  @RequestMapping(method = RequestMethod.POST)
  public String processSubmit(@ModelAttribute("pet") Pet pet, BindingResult result, SessionStatus status) {
    new PetValidator().validate(pet, result);
    if (result.hasErrors()) {
      return "petForm";
    }
    else {
      this.clinic.storePet(pet);
View Full Code Here

Examples of org.springframework.samples.petclinic.validation.PetValidator

    return "petForm";
  }

  @RequestMapping(method = RequestMethod.POST)
  public String processSubmit(@ModelAttribute("pet") Pet pet, BindingResult result, SessionStatus status) {
    new PetValidator().validate(pet, result);
    if (result.hasErrors()) {
      return "petForm";
    }
    else {
      this.clinic.storePet(pet);
View Full Code Here

Examples of org.springframework.samples.petclinic.validation.PetValidator

    return "pets/form";
  }

  @RequestMapping(method = { RequestMethod.PUT, RequestMethod.POST })
  public String processSubmit(@ModelAttribute("pet") Pet pet, BindingResult result, SessionStatus status) {
    new PetValidator().validate(pet, result);
    if (result.hasErrors()) {
      return "pets/form";
    }
    else {
      this.clinic.storePet(pet);
View Full Code Here

Examples of org.springframework.samples.petclinic.validation.PetValidator

    return "pets/form";
  }

  @RequestMapping(method = RequestMethod.POST)
  public String processSubmit(@ModelAttribute("pet") Pet pet, BindingResult result, SessionStatus status) {
    new PetValidator().validate(pet, result);
    if (result.hasErrors()) {
      return "pets/form";
    }
    else {
      this.clinic.storePet(pet);
View Full Code Here

Examples of org.springframework.samples.petportal.validation.PetValidator

    if (request.getParameter("_cancel") != null) {
      response.setRenderParameter("action", "list");
    }
    else if (request.getParameter("_finish") != null) {
      new PetValidator().validate(pet, result);
      if (!result.hasErrors()) {
        this.petService.addPet(pet);
        response.setRenderParameter("action", "list");
      }
      else {
        model.addAttribute("page", currentPage);
      }
    }
    else {
      switch (currentPage) {
        case 0: new PetValidator().validateSpecies(pet, result); break;
        case 1: new PetValidator().validateBreed(pet, result); break;
        case 2: new PetValidator().validateName(pet, result); break;
        case 3: new PetValidator().validateBirthdate(pet, result); break;
      }
      int targetPage = currentPage;
      if (!result.hasErrors()) {
        targetPage = PortletUtils.getTargetPage(request, "_target", currentPage);
      }
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.