Package org.springframework.samples.petportal.domain

Examples of org.springframework.samples.petportal.domain.Pet


    }
    return key;
  }

  public int addPet(String species, String breed, String name, Date birthdate) {
    Pet pet = new Pet(species, breed, name, birthdate);
    return addPet(pet);
  }
View Full Code Here


  @RequestMapping(params = "action=add"// render phase
  public String showPetForm(Model model) {
    // Used for the initial form as well as for redisplaying with errors.
    if (!model.containsAttribute("pet")) {
      model.addAttribute("pet", new Pet());
      model.addAttribute("page", 0);
    }
    return "petAdd";
  }
View Full Code Here

   */
  @RequestMapping  // default action
  public void processUpload(PetDescription upload, @RequestParam("selectedPet") int petKey) {
    byte[] file = upload.getFile();
    String description = new String(file);
    Pet pet = this.petService.getPet(petKey);
    pet.setDescription(description);
    this.petService.savePet(pet);
  }
View Full Code Here

TOP

Related Classes of org.springframework.samples.petportal.domain.Pet

Copyright © 2018 www.massapicom. 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.