Update PetController.java

This commit is contained in:
Yasaswini Desu 2025-02-21 10:35:07 +05:30 committed by GitHub
parent 216a44cc06
commit caf296b34c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -50,11 +50,6 @@ class PetController {
this.owners = owners;
}
@ModelAttribute("types")
public Collection<PetType> populatePetTypes() {
return this.owners.findPetTypes();
}
@ModelAttribute("owner")
public Owner findOwner(@PathVariable("ownerId") int ownerId) {
@ -85,11 +80,6 @@ class PetController {
dataBinder.setDisallowedFields("id");
}
@InitBinder("pet")
public void initPetBinder(WebDataBinder dataBinder) {
dataBinder.setValidator(new PetValidator());
}
@GetMapping("/pets/new")
public String initCreationForm(Owner owner, ModelMap model) {
Pet pet = new Pet();